Class: Io::Flow::V0::Models::ConfigurationType
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::ConfigurationType
- 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 ConfigurationType for this value, creating a new instance for an unknown value.
- .default ⇒ Object
-
.from_string(value) ⇒ Object
Returns the instance of ConfigurationType for this value, or nil if not found.
- .variant ⇒ Object
Instance Method Summary collapse
-
#initialize(value) ⇒ ConfigurationType
constructor
A new instance of ConfigurationType.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ ConfigurationType
Returns a new instance of ConfigurationType.
12488 12489 12490 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12488 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
12486 12487 12488 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12486 def value @value end |
Class Method Details
.ALL ⇒ Object
12508 12509 12510 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12508 def ConfigurationType.ALL @@all ||= [ConfigurationType.default, ConfigurationType.variant] end |
.apply(value) ⇒ Object
Returns the instance of ConfigurationType for this value, creating a new instance for an unknown value
12493 12494 12495 12496 12497 12498 12499 12500 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12493 def ConfigurationType.apply(value) if value.instance_of?(ConfigurationType) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || ConfigurationType.new(value)) end end |
.default ⇒ Object
12512 12513 12514 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12512 def ConfigurationType.default @@_default ||= ConfigurationType.new('default') end |
.from_string(value) ⇒ Object
Returns the instance of ConfigurationType for this value, or nil if not found
12503 12504 12505 12506 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12503 def ConfigurationType.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) ConfigurationType.ALL.find { |v| v.value == value } end |
.variant ⇒ Object
12516 12517 12518 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12516 def ConfigurationType.variant @@_variant ||= ConfigurationType.new('variant') end |
Instance Method Details
#to_hash ⇒ Object
12520 12521 12522 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12520 def to_hash value end |