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.



32818
32819
32820
32821
32822
32823
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32818

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.



32816
32817
32818
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32816

def position
  @position
end

#price_book_keyObject (readonly)

Returns the value of attribute price_book_key.



32816
32817
32818
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32816

def price_book_key
  @price_book_key
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



32829
32830
32831
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32829

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

#to_hashObject



32833
32834
32835
32836
32837
32838
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32833

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

#to_jsonObject



32825
32826
32827
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32825

def to_json
  JSON.dump(to_hash)
end