Class: Activity

Inherits:
Object
  • Object
show all
Defined in:
lib/Activity.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#completedObject

Returns the value of attribute completed.



5
6
7
# File 'lib/Activity.rb', line 5

def completed
  @completed
end

#dateObject (readonly)

Returns the value of attribute date.



4
5
6
# File 'lib/Activity.rb', line 4

def date
  @date
end

#distanceObject (readonly)

Returns the value of attribute distance.



4
5
6
# File 'lib/Activity.rb', line 4

def distance
  @distance
end

#durationObject (readonly)

Returns the value of attribute duration.



4
5
6
# File 'lib/Activity.rb', line 4

def duration
  @duration
end

#typeObject (readonly)

Returns the value of attribute type.



4
5
6
# File 'lib/Activity.rb', line 4

def type
  @type
end

Instance Method Details

#complete_activityObject



14
15
16
# File 'lib/Activity.rb', line 14

def complete_activity
    @completed = true
end