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.
18740 18741 18742 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18740 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
18738 18739 18740 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18738 def value @value end |
Class Method Details
.ALL ⇒ Object
18760 18761 18762 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18760 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
18745 18746 18747 18748 18749 18750 18751 18752 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18745 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).
18766 18767 18768 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18766 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
18755 18756 18757 18758 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18755 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.
18771 18772 18773 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18771 def FulfillmentMethodValue.physical @@_physical ||= FulfillmentMethodValue.new('physical') end |
Instance Method Details
#to_hash ⇒ Object
18775 18776 18777 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18775 def to_hash value end |