Class: GoalAchievement
- Inherits:
-
Object
- Object
- GoalAchievement
- Defined in:
- lib/json/goal_achievement.rb
Instance Attribute Summary collapse
-
#achieved_at ⇒ Object
Returns the value of attribute achieved_at.
-
#name ⇒ Object
Returns the value of attribute name.
-
#properties ⇒ Object
Returns the value of attribute properties.
Instance Method Summary collapse
- #==(o) ⇒ Object
- #hash_code ⇒ Object
-
#initialize(name = nil, achieved_at = nil, properties = nil) ⇒ GoalAchievement
constructor
A new instance of GoalAchievement.
- #to_s ⇒ Object
Constructor Details
#initialize(name = nil, achieved_at = nil, properties = nil) ⇒ GoalAchievement
Returns a new instance of GoalAchievement.
6 7 8 9 10 |
# File 'lib/json/goal_achievement.rb', line 6 def initialize(name = nil, achieved_at = nil, properties = nil) @name = name @achieved_at = achieved_at @properties = properties end |
Instance Attribute Details
#achieved_at ⇒ Object
Returns the value of attribute achieved_at.
4 5 6 |
# File 'lib/json/goal_achievement.rb', line 4 def achieved_at @achieved_at end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/json/goal_achievement.rb', line 4 def name @name end |
#properties ⇒ Object
Returns the value of attribute properties.
4 5 6 |
# File 'lib/json/goal_achievement.rb', line 4 def properties @properties end |
Instance Method Details
#==(o) ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/json/goal_achievement.rb', line 12 def ==(o) return true if self.object_id == o.object_id return false if o.nil? || self.class != o.class that = o @name == that.name && @achieved_at == that.achieved_at && @properties == that.properties end |
#hash_code ⇒ Object
21 22 23 |
# File 'lib/json/goal_achievement.rb', line 21 def hash_code { name: @name, achieved_at: @achieved_at, properties: @properties } end |
#to_s ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/json/goal_achievement.rb', line 25 def to_s "GoalAchievement{" + "name='#{@name}'" + ", achieved_at='#{@achieved_at}'" + ", properties='#{@properties.inspect}'" + "}" end |