Class: InventoryManagementAndItemManagementAndOrderManagementAndPriceManagement::Strategy5

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/inventory_management_and_item_management_and_order_management_and_price_management/models/strategy5.rb

Overview

Strategy5 Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(sku = nil, repricer_strategy = nil, minimum_seller_allowed_price = nil, maximum_seller_allowed_price = nil) ⇒ Strategy5

Returns a new instance of Strategy5.



49
50
51
52
53
54
55
56
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/strategy5.rb', line 49

def initialize(sku = nil, repricer_strategy = nil,
               minimum_seller_allowed_price = nil,
               maximum_seller_allowed_price = nil)
  @sku = sku
  @repricer_strategy = repricer_strategy
  @minimum_seller_allowed_price = minimum_seller_allowed_price
  @maximum_seller_allowed_price = maximum_seller_allowed_price
end

Instance Attribute Details

#maximum_seller_allowed_priceInteger

TODO: Write general description for this method

Returns:

  • (Integer)


27
28
29
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/strategy5.rb', line 27

def maximum_seller_allowed_price
  @maximum_seller_allowed_price
end

#minimum_seller_allowed_priceFloat

TODO: Write general description for this method

Returns:

  • (Float)


23
24
25
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/strategy5.rb', line 23

def minimum_seller_allowed_price
  @minimum_seller_allowed_price
end

#repricer_strategyString

TODO: Write general description for this method

Returns:

  • (String)


19
20
21
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/strategy5.rb', line 19

def repricer_strategy
  @repricer_strategy
end

#skuString

TODO: Write general description for this method

Returns:

  • (String)


15
16
17
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/strategy5.rb', line 15

def sku
  @sku
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/strategy5.rb', line 59

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  sku = hash.key?('sku') ? hash['sku'] : nil
  repricer_strategy =
    hash.key?('repricerStrategy') ? hash['repricerStrategy'] : nil
  minimum_seller_allowed_price =
    hash.key?('minimumSellerAllowedPrice') ? hash['minimumSellerAllowedPrice'] : nil
  maximum_seller_allowed_price =
    hash.key?('maximumSellerAllowedPrice') ? hash['maximumSellerAllowedPrice'] : nil

  # Create object from extracted values.
  Strategy5.new(sku,
                repricer_strategy,
                minimum_seller_allowed_price,
                maximum_seller_allowed_price)
end

.namesObject

A mapping from model property names to API property names.



30
31
32
33
34
35
36
37
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/strategy5.rb', line 30

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['sku'] = 'sku'
  @_hash['repricer_strategy'] = 'repricerStrategy'
  @_hash['minimum_seller_allowed_price'] = 'minimumSellerAllowedPrice'
  @_hash['maximum_seller_allowed_price'] = 'maximumSellerAllowedPrice'
  @_hash
end

.nullablesObject

An array for nullable fields



45
46
47
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/strategy5.rb', line 45

def self.nullables
  []
end

.optionalsObject

An array for optional fields



40
41
42
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/strategy5.rb', line 40

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



87
88
89
90
91
92
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/strategy5.rb', line 87

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} sku: #{@sku.inspect}, repricer_strategy: #{@repricer_strategy.inspect},"\
  " minimum_seller_allowed_price: #{@minimum_seller_allowed_price.inspect},"\
  " maximum_seller_allowed_price: #{@maximum_seller_allowed_price.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



79
80
81
82
83
84
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/strategy5.rb', line 79

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} sku: #{@sku}, repricer_strategy: #{@repricer_strategy},"\
  " minimum_seller_allowed_price: #{@minimum_seller_allowed_price},"\
  " maximum_seller_allowed_price: #{@maximum_seller_allowed_price}>"
end