Class: Io::Flow::V0::Models::BillingAddress

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ BillingAddress



24699
24700
24701
24702
24703
24704
24705
24706
24707
24708
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24699

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  @name = (x = opts.delete(:name); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Name) ? x : ::Io::Flow::V0::Models::Name.new(x)))
  @streets = (x = opts.delete(:streets); x.nil? ? nil : HttpClient::Preconditions.assert_class('streets', x, Array).map { |v| HttpClient::Preconditions.assert_class('streets', v, String) })
  @city = (x = opts.delete(:city); x.nil? ? nil : HttpClient::Preconditions.assert_class('city', x, String))
  @province = (x = opts.delete(:province); x.nil? ? nil : HttpClient::Preconditions.assert_class('province', x, String))
  @postal = (x = opts.delete(:postal); x.nil? ? nil : HttpClient::Preconditions.assert_class('postal', x, String))
  @country = (x = opts.delete(:country); x.nil? ? nil : HttpClient::Preconditions.assert_class('country', x, String))
  @company = (x = opts.delete(:company); x.nil? ? nil : HttpClient::Preconditions.assert_class('company', x, String))
end

Instance Attribute Details

#cityObject (readonly)

Returns the value of attribute city.



24697
24698
24699
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24697

def city
  @city
end

#companyObject (readonly)

Returns the value of attribute company.



24697
24698
24699
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24697

def company
  @company
end

#countryObject (readonly)

Returns the value of attribute country.



24697
24698
24699
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24697

def country
  @country
end

#nameObject (readonly)

Returns the value of attribute name.



24697
24698
24699
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24697

def name
  @name
end

#postalObject (readonly)

Returns the value of attribute postal.



24697
24698
24699
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24697

def postal
  @postal
end

#provinceObject (readonly)

Returns the value of attribute province.



24697
24698
24699
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24697

def province
  @province
end

#streetsObject (readonly)

Returns the value of attribute streets.



24697
24698
24699
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24697

def streets
  @streets
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



24714
24715
24716
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24714

def copy(incoming={})
  BillingAddress.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#to_hashObject



24718
24719
24720
24721
24722
24723
24724
24725
24726
24727
24728
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24718

def to_hash
  {
    :name => name.nil? ? nil : name.to_hash,
    :streets => streets.nil? ? nil : streets,
    :city => city,
    :province => province,
    :postal => postal,
    :country => country,
    :company => company
  }
end

#to_jsonObject



24710
24711
24712
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24710

def to_json
  JSON.dump(to_hash)
end