Class: Io::Flow::V0::Models::RomanizationForm

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

Overview

Information to be romanized

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ RomanizationForm

Returns a new instance of RomanizationForm.



57645
57646
57647
57648
57649
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57645

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::Address) ? x : ::Io::Flow::V0::Models::Address.new(x)))
  @contact = (x = opts.delete(:contact); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Contact) ? x : ::Io::Flow::V0::Models::Contact.new(x)))
end

Instance Attribute Details

#addressObject (readonly)

Returns the value of attribute address.



57643
57644
57645
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57643

def address
  @address
end

#contactObject (readonly)

Returns the value of attribute contact.



57643
57644
57645
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57643

def contact
  @contact
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



57655
57656
57657
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57655

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

#to_hashObject



57659
57660
57661
57662
57663
57664
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57659

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

#to_jsonObject



57651
57652
57653
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57651

def to_json
  JSON.dump(to_hash)
end