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.
13609 13610 13611 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13609 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
13607 13608 13609 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13607 def value @value end |
Class Method Details
.ALL ⇒ Object
13629 13630 13631 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13629 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
13614 13615 13616 13617 13618 13619 13620 13621 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13614 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
13624 13625 13626 13627 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13624 def InputSpecificationType.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) InputSpecificationType.ALL.find { |v| v.value == value } end |
.number ⇒ Object
13637 13638 13639 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13637 def InputSpecificationType.number @@_number ||= InputSpecificationType.new('number') end |
.text ⇒ Object
13633 13634 13635 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13633 def InputSpecificationType.text @@_text ||= InputSpecificationType.new('text') end |
Instance Method Details
#to_hash ⇒ Object
13641 13642 13643 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13641 def to_hash value end |