Class: IActionable::Objects::ProfilePoints
- Inherits:
-
IActionableObject
- Object
- IActionableObject
- IActionable::Objects::ProfilePoints
- Defined in:
- lib/iactionable/objects/profile_points.rb
Instance Attribute Summary collapse
-
#level ⇒ Object
not always present.
-
#point_type ⇒ Object
Returns the value of attribute point_type.
-
#points ⇒ Object
Returns the value of attribute points.
-
#reason ⇒ Object
not always present.
Instance Method Summary collapse
-
#initialize(key_values = {}) ⇒ ProfilePoints
constructor
A new instance of ProfilePoints.
- #to_hash ⇒ Object
Methods inherited from IActionableObject
timestamp_regexp, timestamp_to_seconds
Constructor Details
#initialize(key_values = {}) ⇒ ProfilePoints
Returns a new instance of ProfilePoints.
9 10 11 12 13 14 |
# File 'lib/iactionable/objects/profile_points.rb', line 9 def initialize(key_values={}) levels = key_values.delete("Level") @level = IActionable::Objects::ProfileLevel.new(levels) unless levels.nil? @point_type = IActionable::Objects::PointType.new(key_values.delete("PointType")) super(key_values) end |
Instance Attribute Details
#level ⇒ Object
not always present
4 5 6 |
# File 'lib/iactionable/objects/profile_points.rb', line 4 def level @level end |
#point_type ⇒ Object
Returns the value of attribute point_type.
5 6 7 |
# File 'lib/iactionable/objects/profile_points.rb', line 5 def point_type @point_type end |
#points ⇒ Object
Returns the value of attribute points.
6 7 8 |
# File 'lib/iactionable/objects/profile_points.rb', line 6 def points @points end |
#reason ⇒ Object
not always present
7 8 9 |
# File 'lib/iactionable/objects/profile_points.rb', line 7 def reason @reason end |
Instance Method Details
#to_hash ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/iactionable/objects/profile_points.rb', line 16 def to_hash hash = { "Level" => @level.nil? ? nil : @level.to_hash, "PointType" => @point_type.to_hash, "Points" => @points, "Reason" => @reason } hash.delete "Level" if @level.nil? hash.delete "Reason" if @reason.nil? hash end |