Class: IActionable::Objects::ProfileGoals
- Inherits:
-
IActionableObject
- Object
- IActionableObject
- IActionable::Objects::ProfileGoals
- Defined in:
- lib/iactionable/objects/profile_goals.rb
Instance Attribute Summary collapse
-
#available ⇒ Object
Returns the value of attribute available.
-
#completed ⇒ Object
Returns the value of attribute completed.
Instance Method Summary collapse
-
#initialize(key_values = {}) ⇒ ProfileGoals
constructor
A new instance of ProfileGoals.
- #to_hash ⇒ Object
Methods inherited from IActionableObject
timestamp_regexp, timestamp_to_seconds
Constructor Details
#initialize(key_values = {}) ⇒ ProfileGoals
Returns a new instance of ProfileGoals.
7 8 9 10 |
# File 'lib/iactionable/objects/profile_goals.rb', line 7 def initialize(key_values={}) @available = extract_many_as(key_values, "Available", IActionable::Objects::Goal) @completed = extract_many_as(key_values, "Completed", IActionable::Objects::Goal) end |
Instance Attribute Details
#available ⇒ Object
Returns the value of attribute available.
4 5 6 |
# File 'lib/iactionable/objects/profile_goals.rb', line 4 def available @available end |
#completed ⇒ Object
Returns the value of attribute completed.
5 6 7 |
# File 'lib/iactionable/objects/profile_goals.rb', line 5 def completed @completed end |
Instance Method Details
#to_hash ⇒ Object
12 13 14 15 16 17 |
# File 'lib/iactionable/objects/profile_goals.rb', line 12 def to_hash { "Available" => @available.map{|goal| goal.to_hash}, "Completed" => @completed.map{|goal| goal.to_hash} } end |