Class: IActionable::Objects::Challenge
- Inherits:
-
IActionableObject
- Object
- IActionableObject
- IActionable::Objects::Challenge
- Defined in:
- lib/iactionable/objects/challenge.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#key ⇒ Object
Returns the value of attribute key.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(key_values = {}) ⇒ Challenge
constructor
A new instance of Challenge.
- #to_hash ⇒ Object
Methods inherited from IActionableObject
timestamp_regexp, timestamp_to_seconds
Constructor Details
#initialize(key_values = {}) ⇒ Challenge
Returns a new instance of Challenge.
10 11 12 13 |
# File 'lib/iactionable/objects/challenge.rb', line 10 def initialize(key_values={}) initialize_awardable(key_values) super(key_values) end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
7 8 9 |
# File 'lib/iactionable/objects/challenge.rb', line 7 def description @description end |
#key ⇒ Object
Returns the value of attribute key.
6 7 8 |
# File 'lib/iactionable/objects/challenge.rb', line 6 def key @key end |
#name ⇒ Object
Returns the value of attribute name.
8 9 10 |
# File 'lib/iactionable/objects/challenge.rb', line 8 def name @name end |
Instance Method Details
#to_hash ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/iactionable/objects/challenge.rb', line 15 def to_hash hash = { "Key" => @key, "Description" => @description, "Name" => @name } hash.merge!(awardable_hash) unless @progress.empty? hash.delete("AwardDate") if @award_date.nil? hash end |