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.



35281
35282
35283
35284
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35281

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.



35279
35280
35281
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35279

def address
  @address
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



35290
35291
35292
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35290

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

#to_hashObject



35294
35295
35296
35297
35298
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35294

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

#to_jsonObject



35286
35287
35288
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35286

def to_json
  JSON.dump(to_hash)
end