Class: WalmartApIs::Scopes
- Defined in:
- lib/walmart_ap_is/models/scopes.rb
Overview
Scopes Model.
Instance Attribute Summary collapse
-
#content ⇒ String
TODO: Write general description for this method.
-
#feeds ⇒ String
TODO: Write general description for this method.
-
#inventory ⇒ String
TODO: Write general description for this method.
-
#item ⇒ String
TODO: Write general description for this method.
-
#lagtime ⇒ String
TODO: Write general description for this method.
-
#orders ⇒ String
TODO: Write general description for this method.
-
#price ⇒ String
TODO: Write general description for this method.
-
#reports ⇒ String
TODO: Write general description for this method.
-
#returns ⇒ 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(reports:, item:, price:, lagtime:, feeds:, returns:, orders:, inventory:, content:, additional_properties: nil) ⇒ Scopes
constructor
A new instance of Scopes.
-
#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(reports:, item:, price:, lagtime:, feeds:, returns:, orders:, inventory:, content:, additional_properties: nil) ⇒ Scopes
Returns a new instance of Scopes.
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/walmart_ap_is/models/scopes.rb', line 73 def initialize(reports:, item:, price:, lagtime:, feeds:, returns:, orders:, inventory:, content:, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @reports = reports @item = item @price = price @lagtime = lagtime @feeds = feeds @returns = returns @orders = orders @inventory = inventory @content = content @additional_properties = additional_properties end |
Instance Attribute Details
#content ⇒ String
TODO: Write general description for this method
46 47 48 |
# File 'lib/walmart_ap_is/models/scopes.rb', line 46 def content @content end |
#feeds ⇒ String
TODO: Write general description for this method
30 31 32 |
# File 'lib/walmart_ap_is/models/scopes.rb', line 30 def feeds @feeds end |
#inventory ⇒ String
TODO: Write general description for this method
42 43 44 |
# File 'lib/walmart_ap_is/models/scopes.rb', line 42 def inventory @inventory end |
#item ⇒ String
TODO: Write general description for this method
18 19 20 |
# File 'lib/walmart_ap_is/models/scopes.rb', line 18 def item @item end |
#lagtime ⇒ String
TODO: Write general description for this method
26 27 28 |
# File 'lib/walmart_ap_is/models/scopes.rb', line 26 def lagtime @lagtime end |
#orders ⇒ String
TODO: Write general description for this method
38 39 40 |
# File 'lib/walmart_ap_is/models/scopes.rb', line 38 def orders @orders end |
#price ⇒ String
TODO: Write general description for this method
22 23 24 |
# File 'lib/walmart_ap_is/models/scopes.rb', line 22 def price @price end |
#reports ⇒ String
TODO: Write general description for this method
14 15 16 |
# File 'lib/walmart_ap_is/models/scopes.rb', line 14 def reports @reports end |
#returns ⇒ String
TODO: Write general description for this method
34 35 36 |
# File 'lib/walmart_ap_is/models/scopes.rb', line 34 def returns @returns end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 |
# File 'lib/walmart_ap_is/models/scopes.rb', line 91 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. reports = hash.key?('reports') ? hash['reports'] : nil item = hash.key?('item') ? hash['item'] : nil price = hash.key?('price') ? hash['price'] : nil lagtime = hash.key?('lagtime') ? hash['lagtime'] : nil feeds = hash.key?('feeds') ? hash['feeds'] : nil returns = hash.key?('returns') ? hash['returns'] : nil orders = hash.key?('orders') ? hash['orders'] : nil inventory = hash.key?('inventory') ? hash['inventory'] : nil content = hash.key?('content') ? hash['content'] : 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. Scopes.new(reports: reports, item: item, price: price, lagtime: lagtime, feeds: feeds, returns: returns, orders: orders, inventory: inventory, content: content, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/walmart_ap_is/models/scopes.rb', line 49 def self.names @_hash = {} if @_hash.nil? @_hash['reports'] = 'reports' @_hash['item'] = 'item' @_hash['price'] = 'price' @_hash['lagtime'] = 'lagtime' @_hash['feeds'] = 'feeds' @_hash['returns'] = 'returns' @_hash['orders'] = 'orders' @_hash['inventory'] = 'inventory' @_hash['content'] = 'content' @_hash end |
.nullables ⇒ Object
An array for nullable fields
69 70 71 |
# File 'lib/walmart_ap_is/models/scopes.rb', line 69 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
64 65 66 |
# File 'lib/walmart_ap_is/models/scopes.rb', line 64 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
134 135 136 137 138 139 140 |
# File 'lib/walmart_ap_is/models/scopes.rb', line 134 def inspect class_name = self.class.name.split('::').last "<#{class_name} reports: #{@reports.inspect}, item: #{@item.inspect}, price:"\ " #{@price.inspect}, lagtime: #{@lagtime.inspect}, feeds: #{@feeds.inspect}, returns:"\ " #{@returns.inspect}, orders: #{@orders.inspect}, inventory: #{@inventory.inspect},"\ " content: #{@content.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
126 127 128 129 130 131 |
# File 'lib/walmart_ap_is/models/scopes.rb', line 126 def to_s class_name = self.class.name.split('::').last "<#{class_name} reports: #{@reports}, item: #{@item}, price: #{@price}, lagtime:"\ " #{@lagtime}, feeds: #{@feeds}, returns: #{@returns}, orders: #{@orders}, inventory:"\ " #{@inventory}, content: #{@content}, additional_properties: #{@additional_properties}>" end |