Class: Io::Flow::V0::Models::InputSpecificationType
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::InputSpecificationType
- 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 InputSpecificationType for this value, creating a new instance for an unknown value.
-
.from_string(value) ⇒ Object
Returns the instance of InputSpecificationType for this value, or nil if not found.
- .number ⇒ Object
- .text ⇒ Object
Instance Method Summary collapse
-
#initialize(value) ⇒ InputSpecificationType
constructor
A new instance of InputSpecificationType.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ InputSpecificationType
Returns a new instance of InputSpecificationType.
21599 21600 21601 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21599 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
21597 21598 21599 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21597 def value @value end |
Class Method Details
.ALL ⇒ Object
21619 21620 21621 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21619 def InputSpecificationType.ALL @@all ||= [InputSpecificationType.text, InputSpecificationType.number] end |
.apply(value) ⇒ Object
Returns the instance of InputSpecificationType for this value, creating a new instance for an unknown value
21604 21605 21606 21607 21608 21609 21610 21611 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21604 def InputSpecificationType.apply(value) if value.instance_of?(InputSpecificationType) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || InputSpecificationType.new(value)) end end |
.from_string(value) ⇒ Object
Returns the instance of InputSpecificationType for this value, or nil if not found
21614 21615 21616 21617 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21614 def InputSpecificationType.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) InputSpecificationType.ALL.find { |v| v.value == value } end |
.number ⇒ Object
21627 21628 21629 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21627 def InputSpecificationType.number @@_number ||= InputSpecificationType.new('number') end |
.text ⇒ Object
21623 21624 21625 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21623 def InputSpecificationType.text @@_text ||= InputSpecificationType.new('text') end |
Instance Method Details
#to_hash ⇒ Object
21631 21632 21633 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21631 def to_hash value end |