Class: Io::Flow::V0::Models::Romanization

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

Overview

The data in the this model reflects transliterated text into Roman (Latin) script, a consumable format for system processing

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ Romanization

Returns a new instance of Romanization.



57617
57618
57619
57620
57621
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57617

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.



57615
57616
57617
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57615

def address
  @address
end

#contactObject (readonly)

Returns the value of attribute contact.



57615
57616
57617
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57615

def contact
  @contact
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



57627
57628
57629
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57627

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

#to_hashObject



57631
57632
57633
57634
57635
57636
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57631

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

#to_jsonObject



57623
57624
57625
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57623

def to_json
  JSON.dump(to_hash)
end