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.



50088
50089
50090
50091
50092
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50088

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.



50086
50087
50088
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50086

def address
  @address
end

#contactObject (readonly)

Returns the value of attribute contact.



50086
50087
50088
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50086

def contact
  @contact
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



50098
50099
50100
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50098

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

#to_hashObject



50102
50103
50104
50105
50106
50107
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50102

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

#to_jsonObject



50094
50095
50096
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50094

def to_json
  JSON.dump(to_hash)
end