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.
12518 12519 12520 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12518 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
12516 12517 12518 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12516 def value @value end |
Class Method Details
.ALL ⇒ Object
12538 12539 12540 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12538 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
12523 12524 12525 12526 12527 12528 12529 12530 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12523 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
12533 12534 12535 12536 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12533 def InputSpecificationType.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) InputSpecificationType.ALL.find { |v| v.value == value } end |
.number ⇒ Object
12546 12547 12548 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12546 def InputSpecificationType.number @@_number ||= InputSpecificationType.new('number') end |
.text ⇒ Object
12542 12543 12544 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12542 def InputSpecificationType.text @@_text ||= InputSpecificationType.new('text') end |
Instance Method Details
#to_hash ⇒ Object
12550 12551 12552 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12550 def to_hash value end |