Class: Io::Flow::V0::Models::IdentifierForm

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ IdentifierForm

Returns a new instance of IdentifierForm.



33467
33468
33469
33470
33471
33472
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33467

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:name], 'IdentifierForm')
  @primary = (x = opts.delete(:primary); x.nil? ? nil : HttpClient::Preconditions.assert_boolean('primary', x))
  @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



33465
33466
33467
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33465

def name
  @name
end

#primaryObject (readonly)

Returns the value of attribute primary.



33465
33466
33467
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33465

def primary
  @primary
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



33478
33479
33480
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33478

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

#to_hashObject



33482
33483
33484
33485
33486
33487
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33482

def to_hash
  {
    :primary => primary,
    :name => name
  }
end

#to_jsonObject



33474
33475
33476
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33474

def to_json
  JSON.dump(to_hash)
end