Class: Io::Flow::V0::Models::OrderIdentifierForm

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 = {}) ⇒ OrderIdentifierForm



39132
39133
39134
39135
39136
39137
39138
39139
39140
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39132

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

Instance Attribute Details

#identifierObject (readonly)

Returns the value of attribute identifier.



39130
39131
39132
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39130

def identifier
  @identifier
end

#nameObject (readonly)

Returns the value of attribute name.



39130
39131
39132
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39130

def name
  @name
end

#numberObject (readonly)

Returns the value of attribute number.



39130
39131
39132
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39130

def number
  @number
end

#orderObject (readonly)

Returns the value of attribute order.



39130
39131
39132
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39130

def order
  @order
end

#primaryObject (readonly)

Returns the value of attribute primary.



39130
39131
39132
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39130

def primary
  @primary
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



39146
39147
39148
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39146

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

#to_hashObject



39150
39151
39152
39153
39154
39155
39156
39157
39158
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39150

def to_hash
  {
    :order => order,
    :name => name,
    :identifier => identifier,
    :number => number,
    :primary => primary
  }
end

#to_jsonObject



39142
39143
39144
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39142

def to_json
  JSON.dump(to_hash)
end