Class: IActionable::Objects::ProfileNotifications
- Inherits:
-
IActionableObject
- Object
- IActionableObject
- IActionable::Objects::ProfileNotifications
- Defined in:
- lib/iactionable/objects/profile_notifications.rb
Instance Attribute Summary collapse
-
#achievements ⇒ Object
Returns the value of attribute achievements.
-
#challenges ⇒ Object
Returns the value of attribute challenges.
-
#goals ⇒ Object
Returns the value of attribute goals.
-
#levels ⇒ Object
Returns the value of attribute levels.
-
#points ⇒ Object
Returns the value of attribute points.
Instance Method Summary collapse
-
#initialize(key_values = {}) ⇒ ProfileNotifications
constructor
A new instance of ProfileNotifications.
- #to_hash ⇒ Object
Methods inherited from IActionableObject
timestamp_regexp, timestamp_to_seconds
Constructor Details
#initialize(key_values = {}) ⇒ ProfileNotifications
Returns a new instance of ProfileNotifications.
10 11 12 13 14 15 16 |
# File 'lib/iactionable/objects/profile_notifications.rb', line 10 def initialize(key_values={}) @achievements = IActionable::Objects::ProfileAchievements.new(key_values.delete("Achievements")) @challenges = IActionable::Objects::ProfileChallenges.new(key_values.delete("Challenges")) @goals = IActionable::Objects::ProfileGoals.new(key_values.delete("Goals")) @levels = extract_many_as(key_values, "Levels", IActionable::Objects::Level) @points = extract_many_as(key_values, "Points", IActionable::Objects::ProfilePoints) end |
Instance Attribute Details
#achievements ⇒ Object
Returns the value of attribute achievements.
4 5 6 |
# File 'lib/iactionable/objects/profile_notifications.rb', line 4 def achievements @achievements end |
#challenges ⇒ Object
Returns the value of attribute challenges.
5 6 7 |
# File 'lib/iactionable/objects/profile_notifications.rb', line 5 def challenges @challenges end |
#goals ⇒ Object
Returns the value of attribute goals.
6 7 8 |
# File 'lib/iactionable/objects/profile_notifications.rb', line 6 def goals @goals end |
#levels ⇒ Object
Returns the value of attribute levels.
7 8 9 |
# File 'lib/iactionable/objects/profile_notifications.rb', line 7 def levels @levels end |
#points ⇒ Object
Returns the value of attribute points.
8 9 10 |
# File 'lib/iactionable/objects/profile_notifications.rb', line 8 def points @points end |
Instance Method Details
#to_hash ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/iactionable/objects/profile_notifications.rb', line 18 def to_hash { "Achievements" => @achievements.to_hash, "Challenges" => @challenges.to_hash, "Goals" => @goals.to_hash, "Levels" => @levels.map{|level| level.to_hash}, "Points" => @points.map{|point| point.to_hash} } end |