Class: Activity
- Inherits:
-
Object
- Object
- Activity
- Defined in:
- lib/Activity.rb
Instance Attribute Summary collapse
-
#completed ⇒ Object
Returns the value of attribute completed.
-
#date ⇒ Object
readonly
Returns the value of attribute date.
-
#distance ⇒ Object
readonly
Returns the value of attribute distance.
-
#duration ⇒ Object
readonly
Returns the value of attribute duration.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #complete_activity ⇒ Object
-
#initialize(type, distance, duration, date) ⇒ Activity
constructor
A new instance of Activity.
Constructor Details
#initialize(type, distance, duration, date) ⇒ Activity
6 7 8 9 10 11 12 |
# File 'lib/Activity.rb', line 6 def initialize(type, distance, duration, date) @type = type @distance = distance @duration = duration @date = date @completed = false end |
Instance Attribute Details
#completed ⇒ Object
Returns the value of attribute completed.
5 6 7 |
# File 'lib/Activity.rb', line 5 def completed @completed end |
#date ⇒ Object (readonly)
Returns the value of attribute date.
4 5 6 |
# File 'lib/Activity.rb', line 4 def date @date end |
#distance ⇒ Object (readonly)
Returns the value of attribute distance.
4 5 6 |
# File 'lib/Activity.rb', line 4 def distance @distance end |
#duration ⇒ Object (readonly)
Returns the value of attribute duration.
4 5 6 |
# File 'lib/Activity.rb', line 4 def duration @duration end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
4 5 6 |
# File 'lib/Activity.rb', line 4 def type @type end |
Instance Method Details
#complete_activity ⇒ Object
14 15 16 |
# File 'lib/Activity.rb', line 14 def complete_activity @completed = true end |