Class: WalmartApIs::Strategy5
- Defined in:
- lib/walmart_ap_is/models/strategy5.rb
Overview
Strategy5 Model.
Instance Attribute Summary collapse
-
#maximum_seller_allowed_price ⇒ Integer
TODO: Write general description for this method.
-
#minimum_seller_allowed_price ⇒ Float
TODO: Write general description for this method.
-
#repricer_strategy ⇒ String
TODO: Write general description for this method.
-
#sku ⇒ String
TODO: Write general description for this method.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(sku:, repricer_strategy:, minimum_seller_allowed_price:, maximum_seller_allowed_price:, additional_properties: nil) ⇒ Strategy5
constructor
A new instance of Strategy5.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
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:, repricer_strategy:, minimum_seller_allowed_price:, maximum_seller_allowed_price:, additional_properties: nil) ⇒ Strategy5
Returns a new instance of Strategy5.
48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/walmart_ap_is/models/strategy5.rb', line 48 def initialize(sku:, repricer_strategy:, minimum_seller_allowed_price:, maximum_seller_allowed_price:, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @sku = sku @repricer_strategy = repricer_strategy @minimum_seller_allowed_price = minimum_seller_allowed_price @maximum_seller_allowed_price = maximum_seller_allowed_price @additional_properties = additional_properties end |
Instance Attribute Details
#maximum_seller_allowed_price ⇒ Integer
TODO: Write general description for this method
26 27 28 |
# File 'lib/walmart_ap_is/models/strategy5.rb', line 26 def maximum_seller_allowed_price @maximum_seller_allowed_price end |
#minimum_seller_allowed_price ⇒ Float
TODO: Write general description for this method
22 23 24 |
# File 'lib/walmart_ap_is/models/strategy5.rb', line 22 def minimum_seller_allowed_price @minimum_seller_allowed_price end |
#repricer_strategy ⇒ String
TODO: Write general description for this method
18 19 20 |
# File 'lib/walmart_ap_is/models/strategy5.rb', line 18 def repricer_strategy @repricer_strategy end |
#sku ⇒ String
TODO: Write general description for this method
14 15 16 |
# File 'lib/walmart_ap_is/models/strategy5.rb', line 14 def sku @sku end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/walmart_ap_is/models/strategy5.rb', line 61 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 a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. Strategy5.new(sku: sku, repricer_strategy: repricer_strategy, minimum_seller_allowed_price: minimum_seller_allowed_price, maximum_seller_allowed_price: maximum_seller_allowed_price, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
29 30 31 32 33 34 35 36 |
# File 'lib/walmart_ap_is/models/strategy5.rb', line 29 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 |
.nullables ⇒ Object
An array for nullable fields
44 45 46 |
# File 'lib/walmart_ap_is/models/strategy5.rb', line 44 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
39 40 41 |
# File 'lib/walmart_ap_is/models/strategy5.rb', line 39 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
98 99 100 101 102 103 104 |
# File 'lib/walmart_ap_is/models/strategy5.rb', line 98 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},"\ " additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
89 90 91 92 93 94 95 |
# File 'lib/walmart_ap_is/models/strategy5.rb', line 89 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}, additional_properties:"\ " #{@additional_properties}>" end |