class AgridClient::Customer

Attributes

avatar[RW]

URL of customer's avatar image

email[RW]

Email address

id[RW]

Unique Id

name[RW]

Customer's name

phone[RW]

Phone number

Public Class Methods

attribute_map() click to toggle source

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

# File lib/agrid_client/models/customer.rb, line 36
def self.attribute_map
  {
    :'id' => :'id',
    :'avatar' => :'avatar',
    :'name' => :'name',
    :'email' => :'email',
    :'phone' => :'phone'
  }
end
new(attributes = {}) click to toggle source

Initializes the object @param [Hash] attributes Model attributes in the form of hash

# File lib/agrid_client/models/customer.rb, line 59
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[:'id']
    self.id = attributes[:'id']
  end
  if attributes[:'avatar']
    self.avatar = attributes[:'avatar']
  end
  if attributes[:'name']
    self.name = attributes[:'name']
  end
  if attributes[:'email']
    self.email = attributes[:'email']
  end
  if attributes[:'phone']
    self.phone = attributes[:'phone']
  end
end
swagger_types() click to toggle source

Attribute type mapping.

# File lib/agrid_client/models/customer.rb, line 47
def self.swagger_types
  {
    :'id' => :'String',
    :'avatar' => :'String',
    :'name' => :'String',
    :'email' => :'String',
    :'phone' => :'String'
  }
end

Public Instance Methods

==(o) click to toggle source

Checks equality by comparing each attribute. @param [Object] Object to be compared

# File lib/agrid_client/models/customer.rb, line 84
def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      id == o.id
end