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

Returns a new instance of OrderIdentifierForm.



46143
46144
46145
46146
46147
46148
46149
46150
46151
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46143

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.



46141
46142
46143
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46141

def identifier
  @identifier
end

#nameObject (readonly)

Returns the value of attribute name.



46141
46142
46143
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46141

def name
  @name
end

#numberObject (readonly)

Returns the value of attribute number.



46141
46142
46143
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46141

def number
  @number
end

#orderObject (readonly)

Returns the value of attribute order.



46141
46142
46143
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46141

def order
  @order
end

#primaryObject (readonly)

Returns the value of attribute primary.



46141
46142
46143
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46141

def primary
  @primary
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



46157
46158
46159
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46157

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

#to_hashObject



46161
46162
46163
46164
46165
46166
46167
46168
46169
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46161

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

#to_jsonObject



46153
46154
46155
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46153

def to_json
  JSON.dump(to_hash)
end