Class: Io::Flow::V0::Models::FulfillmentMethodValue
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::FulfillmentMethodValue
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Class Method Summary collapse
- .ALL ⇒ Object
-
.apply(value) ⇒ Object
Returns the instance of FulfillmentMethodValue for this value, creating a new instance for an unknown value.
-
.digital ⇒ Object
Indicates item will be fulfilled digitally and no shipment is required (e.g. Gift Card).
-
.from_string(value) ⇒ Object
Returns the instance of FulfillmentMethodValue for this value, or nil if not found.
-
.physical ⇒ Object
Indicates item will be shipped in a physical package.
Instance Method Summary collapse
-
#initialize(value) ⇒ FulfillmentMethodValue
constructor
A new instance of FulfillmentMethodValue.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ FulfillmentMethodValue
Returns a new instance of FulfillmentMethodValue.
13145 13146 13147 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13145 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
13143 13144 13145 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13143 def value @value end |
Class Method Details
.ALL ⇒ Object
13165 13166 13167 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13165 def FulfillmentMethodValue.ALL @@all ||= [FulfillmentMethodValue.digital, FulfillmentMethodValue.physical] end |
.apply(value) ⇒ Object
Returns the instance of FulfillmentMethodValue for this value, creating a new instance for an unknown value
13150 13151 13152 13153 13154 13155 13156 13157 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13150 def FulfillmentMethodValue.apply(value) if value.instance_of?(FulfillmentMethodValue) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || FulfillmentMethodValue.new(value)) end end |
.digital ⇒ Object
Indicates item will be fulfilled digitally and no shipment is required (e.g. Gift Card).
13171 13172 13173 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13171 def FulfillmentMethodValue.digital @@_digital ||= FulfillmentMethodValue.new('digital') end |
.from_string(value) ⇒ Object
Returns the instance of FulfillmentMethodValue for this value, or nil if not found
13160 13161 13162 13163 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13160 def FulfillmentMethodValue.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) FulfillmentMethodValue.ALL.find { |v| v.value == value } end |
.physical ⇒ Object
Indicates item will be shipped in a physical package.
13176 13177 13178 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13176 def FulfillmentMethodValue.physical @@_physical ||= FulfillmentMethodValue.new('physical') end |
Instance Method Details
#to_hash ⇒ Object
13180 13181 13182 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13180 def to_hash value end |