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.



31683
31684
31685
31686
31687
31688
31689
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31683

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.



31681
31682
31683
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31681

def issuing_country
  @issuing_country
end

#nameObject (readonly)

Returns the value of attribute name.



31681
31682
31683
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31681

def name
  @name
end

#numberObject (readonly)

Returns the value of attribute number.



31681
31682
31683
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31681

def number
  @number
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



31695
31696
31697
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31695

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

#to_hashObject



31699
31700
31701
31702
31703
31704
31705
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31699

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

#to_jsonObject



31691
31692
31693
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31691

def to_json
  JSON.dump(to_hash)
end