Class: Io::Flow::V0::Models::MerchantOfRecord
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::MerchantOfRecord
- 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 MerchantOfRecord for this value, creating a new instance for an unknown value.
- .flow ⇒ Object
-
.from_string(value) ⇒ Object
Returns the instance of MerchantOfRecord for this value, or nil if not found.
- .organization ⇒ Object
Instance Method Summary collapse
-
#initialize(value) ⇒ MerchantOfRecord
constructor
A new instance of MerchantOfRecord.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ MerchantOfRecord
Returns a new instance of MerchantOfRecord.
16652 16653 16654 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16652 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
16650 16651 16652 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16650 def value @value end |
Class Method Details
.ALL ⇒ Object
16672 16673 16674 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16672 def MerchantOfRecord.ALL @@all ||= [MerchantOfRecord.flow, MerchantOfRecord.organization] end |
.apply(value) ⇒ Object
Returns the instance of MerchantOfRecord for this value, creating a new instance for an unknown value
16657 16658 16659 16660 16661 16662 16663 16664 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16657 def MerchantOfRecord.apply(value) if value.instance_of?(MerchantOfRecord) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || MerchantOfRecord.new(value)) end end |
.flow ⇒ Object
16676 16677 16678 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16676 def MerchantOfRecord.flow @@_flow ||= MerchantOfRecord.new('flow') end |
.from_string(value) ⇒ Object
Returns the instance of MerchantOfRecord for this value, or nil if not found
16667 16668 16669 16670 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16667 def MerchantOfRecord.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) MerchantOfRecord.ALL.find { |v| v.value == value } end |
.organization ⇒ Object
16680 16681 16682 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16680 def MerchantOfRecord.organization @@_organization ||= MerchantOfRecord.new('organization') end |
Instance Method Details
#to_hash ⇒ Object
16684 16685 16686 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16684 def to_hash value end |