Class: Io::Flow::V0::Models::RateType
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::RateType
- 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 RateType for this value, creating a new instance for an unknown value.
-
.flow ⇒ Object
Represents a Flow rate type (which excludes currency margins).
-
.from_string(value) ⇒ Object
Returns the instance of RateType for this value, or nil if not found.
-
.organization ⇒ Object
Represents an organization rate type (which includes currency margins).
Instance Method Summary collapse
-
#initialize(value) ⇒ RateType
constructor
A new instance of RateType.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ RateType
Returns a new instance of RateType.
14835 14836 14837 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14835 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
14833 14834 14835 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14833 def value @value end |
Class Method Details
.ALL ⇒ Object
14855 14856 14857 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14855 def RateType.ALL @@all ||= [RateType.flow, RateType.organization] end |
.apply(value) ⇒ Object
Returns the instance of RateType for this value, creating a new instance for an unknown value
14840 14841 14842 14843 14844 14845 14846 14847 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14840 def RateType.apply(value) if value.instance_of?(RateType) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || RateType.new(value)) end end |
.flow ⇒ Object
Represents a Flow rate type (which excludes currency margins)
14860 14861 14862 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14860 def RateType.flow @@_flow ||= RateType.new('flow') end |
.from_string(value) ⇒ Object
Returns the instance of RateType for this value, or nil if not found
14850 14851 14852 14853 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14850 def RateType.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) RateType.ALL.find { |v| v.value == value } end |
.organization ⇒ Object
Represents an organization rate type (which includes currency margins)
14865 14866 14867 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14865 def RateType.organization @@_organization ||= RateType.new('organization') end |
Instance Method Details
#to_hash ⇒ Object
14869 14870 14871 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14869 def to_hash value end |