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.



35682
35683
35684
35685
35686
35687
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35682

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.



35680
35681
35682
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35680

def name
  @name
end

#primaryObject (readonly)

Returns the value of attribute primary.



35680
35681
35682
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35680

def primary
  @primary
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



35693
35694
35695
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35693

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

#to_hashObject



35697
35698
35699
35700
35701
35702
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35697

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

#to_jsonObject



35689
35690
35691
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35689

def to_json
  JSON.dump(to_hash)
end