Class: Io::Flow::V0::Models::ExperiencePriceBookMappingForm

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

Returns a new instance of ExperiencePriceBookMappingForm.



19188
19189
19190
19191
19192
19193
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19188

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:price_book_key], 'ExperiencePriceBookMappingForm')
  @price_book_key = HttpClient::Preconditions.assert_class('price_book_key', opts.delete(:price_book_key), String)
  @position = (x = opts.delete(:position); x.nil? ? nil : HttpClient::Preconditions.assert_class('position', x, Integer))
end

Instance Attribute Details

#positionObject (readonly)

Returns the value of attribute position.



19186
19187
19188
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19186

def position
  @position
end

#price_book_keyObject (readonly)

Returns the value of attribute price_book_key.



19186
19187
19188
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19186

def price_book_key
  @price_book_key
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



19199
19200
19201
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19199

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

#to_hashObject



19203
19204
19205
19206
19207
19208
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19203

def to_hash
  {
    :price_book_key => price_book_key,
    :position => position
  }
end

#to_jsonObject



19195
19196
19197
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19195

def to_json
  JSON.dump(to_hash)
end