Class: SomTimer::Exercise

Inherits:
Object
  • Object
show all
Defined in:
lib/som_timer/poros/exercise.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes) ⇒ Exercise

Returns a new instance of Exercise.



7
8
9
10
11
12
# File 'lib/som_timer/poros/exercise.rb', line 7

def initialize(attributes)
  @id = attributes[:id]
  @url = attributes[:url]
  @duration = attributes[:duration]
  @category = attributes[:category].split(".")[1]
end

Instance Attribute Details

#categoryObject (readonly)

Returns the value of attribute category.



2
3
4
# File 'lib/som_timer/poros/exercise.rb', line 2

def category
  @category
end

#durationObject (readonly)

Returns the value of attribute duration.



2
3
4
# File 'lib/som_timer/poros/exercise.rb', line 2

def duration
  @duration
end

#idObject (readonly)

Returns the value of attribute id.



2
3
4
# File 'lib/som_timer/poros/exercise.rb', line 2

def id
  @id
end

#urlObject (readonly)

Returns the value of attribute url.



2
3
4
# File 'lib/som_timer/poros/exercise.rb', line 2

def url
  @url
end