Class: Io::Flow::V0::Models::EntityIdentifier

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

Overview

Tax identifier could be associated to a merchant of record entity.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ EntityIdentifier

Returns a new instance of EntityIdentifier.



37896
37897
37898
37899
37900
37901
37902
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37896

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:name, :number], 'EntityIdentifier')
  @name = (x = opts.delete(:name); x.is_a?(::Io::Flow::V0::Models::EntityIdentifierType) ? x : ::Io::Flow::V0::Models::EntityIdentifierType.apply(x))
  @number = HttpClient::Preconditions.assert_class('number', opts.delete(:number), String)
  @issuing_country = (x = opts.delete(:issuing_country); x.nil? ? nil : HttpClient::Preconditions.assert_class('issuing_country', x, String))
end

Instance Attribute Details

#issuing_countryObject (readonly)

Returns the value of attribute issuing_country.



37894
37895
37896
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37894

def issuing_country
  @issuing_country
end

#nameObject (readonly)

Returns the value of attribute name.



37894
37895
37896
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37894

def name
  @name
end

#numberObject (readonly)

Returns the value of attribute number.



37894
37895
37896
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37894

def number
  @number
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



37908
37909
37910
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37908

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

#to_hashObject



37912
37913
37914
37915
37916
37917
37918
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37912

def to_hash
  {
    :name => name.value,
    :number => number,
    :issuing_country => issuing_country
  }
end

#to_jsonObject



37904
37905
37906
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37904

def to_json
  JSON.dump(to_hash)
end