Class: SomTimer::Exercise
- Inherits:
-
Object
- Object
- SomTimer::Exercise
- Defined in:
- lib/som_timer/poros/exercise.rb
Instance Attribute Summary collapse
-
#category ⇒ Object
readonly
Returns the value of attribute category.
-
#duration ⇒ Object
readonly
Returns the value of attribute duration.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(attributes) ⇒ Exercise
constructor
A new instance of Exercise.
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
#category ⇒ Object (readonly)
Returns the value of attribute category.
2 3 4 |
# File 'lib/som_timer/poros/exercise.rb', line 2 def category @category end |
#duration ⇒ Object (readonly)
Returns the value of attribute duration.
2 3 4 |
# File 'lib/som_timer/poros/exercise.rb', line 2 def duration @duration end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
2 3 4 |
# File 'lib/som_timer/poros/exercise.rb', line 2 def id @id end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
2 3 4 |
# File 'lib/som_timer/poros/exercise.rb', line 2 def url @url end |