Class: AgridClient::Phone

Inherits:
Object
  • Object
show all
Includes:
SwaggerModel
Defined in:
lib/agrid_client/models/phone.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from SwaggerModel

#_deserialize, #_to_hash, #build_from_hash, #eql?, #to_body, #to_hash

Constructor Details

#initialize(attributes = {}) ⇒ Phone

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



43
44
45
46
47
48
49
50
51
52
53
# File 'lib/agrid_client/models/phone.rb', line 43

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}

  
  self.number           = attributes[:'number'] if attributes[:'number']
  self.person_in_charge = attributes[:'person_in_charge'] if attributes[:'person_in_charge']
  self.phone_type       = attributes[:'phone_type'] if attributes[:'phone_type']
end

Instance Attribute Details

#numberObject

Company phone number



21
22
23
# File 'lib/agrid_client/models/phone.rb', line 21

def number
  @number
end

#person_in_chargeObject

Company phone number



21
22
23
# File 'lib/agrid_client/models/phone.rb', line 21

def person_in_charge
  @person_in_charge
end

#phone_typeObject

Company phone number



21
22
23
# File 'lib/agrid_client/models/phone.rb', line 21

def phone_type
  @phone_type
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



24
25
26
27
28
29
30
# File 'lib/agrid_client/models/phone.rb', line 24

def self.attribute_map
  {
    :'number' => :'number',
    :'person_in_charge' => :'person_in_charge',
    :'phone_type' => :'phone_type'
  }
end

.swagger_typesObject

Attribute type mapping.



33
34
35
36
37
38
39
# File 'lib/agrid_client/models/phone.rb', line 33

def self.swagger_types
  {
    :'number' => :'String',
    :'person_in_charge' => :'String',
    :'phone_type' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



57
58
59
60
61
62
63
# File 'lib/agrid_client/models/phone.rb', line 57

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      number == o.number &&
      person_in_charge == o.person_in_charge &&
      phone_type == o.phone_type
end