Class: Io::Flow::V0::Models::CustomerInvoice

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 = {}) ⇒ CustomerInvoice

Returns a new instance of CustomerInvoice.



26943
26944
26945
26946
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26943

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  @address = (x = opts.delete(:address); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::BillingAddress) ? x : ::Io::Flow::V0::Models::BillingAddress.new(x)))
end

Instance Attribute Details

#addressObject (readonly)

Returns the value of attribute address.



26941
26942
26943
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26941

def address
  @address
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



26952
26953
26954
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26952

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

#to_hashObject



26956
26957
26958
26959
26960
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26956

def to_hash
  {
    :address => address.nil? ? nil : address.to_hash
  }
end

#to_jsonObject



26948
26949
26950
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26948

def to_json
  JSON.dump(to_hash)
end