Sha256: f3bbcc80d0ab7650373477b606bc4dc59168c67d5697094cf5e6a5df8bec29f5

Contents?: true

Size: 1.06 KB

Versions: 6

Compression:

Stored size: 1.06 KB

Contents

module CarrierBotAPI
  class Address
    attr_accessor :country, :postal_code, :province, :city, :name, :address1, :address2, :address3, :phone, :fax, :email, :address_type, :company_name

    def initialize(data)
      @country = data[:country]
      @postal_code = data[:postal_code]
      @province = data[:province]
      @city = data[:city]
      @name = data[:name]
      @address1 = data[:address1]
      @address2 = data[:address2]
      @address3 = data[:address3]
      @phone = data[:phone]
      @fax = data[:fax]
      @email = data[:email]
      @address_type = data[:address_type]
      @company_name = data[:company_name]
    end

    def to_json
      {
        'country': self.country, 'postal_code': self.postal_code, 'province': self.province, 'city': self.city, 'name': self.name,
        'address1': self.address1, 'address2': self.address2, 'address3': self.address3,
        'phone': self.phone, 'fax': self.fax, 'email': self.email, 'address_type': self.address_type,
        'company_name': self.company_name
      }
    end
  end
end # module CarrierBot

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
carrierbot_api-0.5.3 lib/carrierbot_api/address.rb
carrierbot_api-0.5.2 lib/carrierbot_api/address.rb
carrierbot_api-0.5.1 lib/carrierbot_api/address.rb
carrierbot_api-0.5.0 lib/carrierbot_api/address.rb
carrierbot_api-0.4.0 lib/carrierbot_api/address.rb
carrierbot_api-0.3.0 lib/carrierbot_api/address.rb