Class: CustomFieldValue

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, value, type) ⇒ CustomFieldValue

Returns a new instance of CustomFieldValue.



6
7
8
9
10
# File 'lib/json/custom_field_value.rb', line 6

def initialize(name, value, type)
  @name = name
  @type = type
  @value = value
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

#typeObject

Returns the value of attribute type.



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

def type
  @type
end

#valueObject

Returns the value of attribute value.



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

def value
  @value
end

Instance Method Details

#==(o) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/json/custom_field_value.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 && @type == that.type  && @value == that.value
end

#hash_codeObject



20
21
22
# File 'lib/json/custom_field_value.rb', line 20

def hash_code
  { name: @name, type: @type, value: @value }
end

#to_sObject



24
25
26
27
28
29
30
# File 'lib/json/custom_field_value.rb', line 24

def to_s
  "CustomFieldValue{" +
    "name='#{@name}'" +
    ", type='#{@type}'" +
    ", value='#{@value}'" +
    "}"
end