Class: AgridClient::CustomerInput

Inherits:
Object
  • Object
show all
Includes:
SwaggerModel
Defined in:
lib/agrid_client/models/customer_input.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 = {}) ⇒ CustomerInput

Initializes the object

Parameters:

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

    Model attributes in the form of hash



46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/agrid_client/models/customer_input.rb', line 46

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}

  if attributes[:'email']
    self.email = attributes[:'email']
  end
  if attributes[:'phone']
    self.phone = attributes[:'phone']
  end
  if attributes[:'name']
    self.name = attributes[:'name']
  end
end

Instance Attribute Details

#emailObject

Returns the value of attribute email.



20
21
22
# File 'lib/agrid_client/models/customer_input.rb', line 20

def email
  @email
end

#nameObject

Returns the value of attribute name.



24
25
26
# File 'lib/agrid_client/models/customer_input.rb', line 24

def name
  @name
end

#phoneObject

Returns the value of attribute phone.



22
23
24
# File 'lib/agrid_client/models/customer_input.rb', line 22

def phone
  @phone
end

Class Method Details

.attribute_mapObject

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



27
28
29
30
31
32
33
# File 'lib/agrid_client/models/customer_input.rb', line 27

def self.attribute_map
  {
    :'email' => :'email',
    :'phone' => :'phone',
    :'name' => :'name'
  }
end

.swagger_typesObject

Attribute type mapping.



36
37
38
39
40
41
42
# File 'lib/agrid_client/models/customer_input.rb', line 36

def self.swagger_types
  {
    :'email' => :'String',
    :'phone' => :'String',
    :'name' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



65
66
67
68
69
70
71
# File 'lib/agrid_client/models/customer_input.rb', line 65

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      email == o.email &&
      phone == o.phone &&
      name == o.name
end