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 phystical 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.
9012 9013 9014 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9012 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
9010 9011 9012 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9010 def value @value end |
Class Method Details
.ALL ⇒ Object
9032 9033 9034 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9032 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
9017 9018 9019 9020 9021 9022 9023 9024 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9017 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).
9038 9039 9040 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9038 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
9027 9028 9029 9030 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9027 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 phystical package.
9043 9044 9045 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9043 def FulfillmentMethodValue.physical @@_physical ||= FulfillmentMethodValue.new('physical') end |
Instance Method Details
#to_hash ⇒ Object
9047 9048 9049 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9047 def to_hash value end |