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