Class: GoalAchievement

Inherits:
Object
  • Object
show all
Defined in:
lib/json/goal_achievement.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_atObject

Returns the value of attribute achieved_at.



4
5
6
# File 'lib/json/goal_achievement.rb', line 4

def achieved_at
  @achieved_at
end

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/json/goal_achievement.rb', line 4

def name
  @name
end

#propertiesObject

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_codeObject



21
22
23
# File 'lib/json/goal_achievement.rb', line 21

def hash_code
  { name: @name, achieved_at: @achieved_at, properties: @properties }
end

#to_sObject



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