Class: Io::Flow::V0::Models::ExceptionType
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::ExceptionType
- 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 ExceptionType for this value, creating a new instance for an unknown value.
- .closed ⇒ Object
-
.from_string(value) ⇒ Object
Returns the instance of ExceptionType for this value, or nil if not found.
- .open ⇒ Object
Instance Method Summary collapse
-
#initialize(value) ⇒ ExceptionType
constructor
A new instance of ExceptionType.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ ExceptionType
Returns a new instance of ExceptionType.
12894 12895 12896 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12894 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
12892 12893 12894 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12892 def value @value end |
Class Method Details
.ALL ⇒ Object
12914 12915 12916 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12914 def ExceptionType.ALL @@all ||= [ExceptionType.open, ExceptionType.closed] end |
.apply(value) ⇒ Object
Returns the instance of ExceptionType for this value, creating a new instance for an unknown value
12899 12900 12901 12902 12903 12904 12905 12906 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12899 def ExceptionType.apply(value) if value.instance_of?(ExceptionType) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || ExceptionType.new(value)) end end |
.closed ⇒ Object
12922 12923 12924 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12922 def ExceptionType.closed @@_closed ||= ExceptionType.new('closed') end |
.from_string(value) ⇒ Object
Returns the instance of ExceptionType for this value, or nil if not found
12909 12910 12911 12912 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12909 def ExceptionType.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) ExceptionType.ALL.find { |v| v.value == value } end |
.open ⇒ Object
12918 12919 12920 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12918 def ExceptionType.open @@_open ||= ExceptionType.new('open') end |
Instance Method Details
#to_hash ⇒ Object
12926 12927 12928 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12926 def to_hash value end |