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.
16850 16851 16852 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16850 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
16848 16849 16850 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16848 def value @value end |
Class Method Details
.ALL ⇒ Object
16870 16871 16872 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16870 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
16855 16856 16857 16858 16859 16860 16861 16862 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16855 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
16865 16866 16867 16868 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16865 def InputSpecificationType.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) InputSpecificationType.ALL.find { |v| v.value == value } end |
.number ⇒ Object
16878 16879 16880 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16878 def InputSpecificationType.number @@_number ||= InputSpecificationType.new('number') end |
.text ⇒ Object
16874 16875 16876 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16874 def InputSpecificationType.text @@_text ||= InputSpecificationType.new('text') end |
Instance Method Details
#to_hash ⇒ Object
16882 16883 16884 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16882 def to_hash value end |