Class: NewStoreApi::FulfillmentConfigRoute
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- NewStoreApi::FulfillmentConfigRoute
- Defined in:
- lib/new_store_api/models/fulfillment_config_route.rb
Overview
Single fulfillment config route entry (Routes.json).
Instance Attribute Summary collapse
-
#destination_region ⇒ FulfillmentConfigDestinationRegion
Destination region for a fulfillment config route (Routes.json).
-
#fulfilled_by ⇒ Hash[String, Object]
Service level identifiers mapped to location group IDs that may serve each level for the route.
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(destination_region = nil, fulfilled_by = nil) ⇒ FulfillmentConfigRoute
constructor
A new instance of FulfillmentConfigRoute.
-
#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(destination_region = nil, fulfilled_by = nil) ⇒ FulfillmentConfigRoute
Returns a new instance of FulfillmentConfigRoute.
39 40 41 42 |
# File 'lib/new_store_api/models/fulfillment_config_route.rb', line 39 def initialize(destination_region = nil, fulfilled_by = nil) @destination_region = destination_region @fulfilled_by = fulfilled_by end |
Instance Attribute Details
#destination_region ⇒ FulfillmentConfigDestinationRegion
Destination region for a fulfillment config route (Routes.json).
14 15 16 |
# File 'lib/new_store_api/models/fulfillment_config_route.rb', line 14 def destination_region @destination_region end |
#fulfilled_by ⇒ Hash[String, Object]
Service level identifiers mapped to location group IDs that may serve each level for the route.
19 20 21 |
# File 'lib/new_store_api/models/fulfillment_config_route.rb', line 19 def fulfilled_by @fulfilled_by end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/new_store_api/models/fulfillment_config_route.rb', line 45 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. if hash['destination_region'] destination_region = FulfillmentConfigDestinationRegion.from_hash(hash['destination_region']) end fulfilled_by = hash.key?('fulfilled_by') ? hash['fulfilled_by'] : nil # Create object from extracted values. FulfillmentConfigRoute.new(destination_region, fulfilled_by) end |
.names ⇒ Object
A mapping from model property names to API property names.
22 23 24 25 26 27 |
# File 'lib/new_store_api/models/fulfillment_config_route.rb', line 22 def self.names @_hash = {} if @_hash.nil? @_hash['destination_region'] = 'destination_region' @_hash['fulfilled_by'] = 'fulfilled_by' @_hash end |
.nullables ⇒ Object
An array for nullable fields
35 36 37 |
# File 'lib/new_store_api/models/fulfillment_config_route.rb', line 35 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
30 31 32 |
# File 'lib/new_store_api/models/fulfillment_config_route.rb', line 30 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
67 68 69 70 71 |
# File 'lib/new_store_api/models/fulfillment_config_route.rb', line 67 def inspect class_name = self.class.name.split('::').last "<#{class_name} destination_region: #{@destination_region.inspect}, fulfilled_by:"\ " #{@fulfilled_by.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
60 61 62 63 64 |
# File 'lib/new_store_api/models/fulfillment_config_route.rb', line 60 def to_s class_name = self.class.name.split('::').last "<#{class_name} destination_region: #{@destination_region}, fulfilled_by:"\ " #{@fulfilled_by}>" end |