Class: Io::Flow::V0::Models::ExceptionType

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ ExceptionType

Returns a new instance of ExceptionType.



16133
16134
16135
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16133

def initialize(value)
  @value = HttpClient::Preconditions.assert_class('value', value, String)
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



16131
16132
16133
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16131

def value
  @value
end

Class Method Details

.ALLObject



16153
16154
16155
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16153

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



16138
16139
16140
16141
16142
16143
16144
16145
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16138

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

.closedObject



16161
16162
16163
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16161

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



16148
16149
16150
16151
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16148

def ExceptionType.from_string(value)
  HttpClient::Preconditions.assert_class('value', value, String)
  ExceptionType.ALL.find { |v| v.value == value }
end

.openObject



16157
16158
16159
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16157

def ExceptionType.open
  @@_open ||= ExceptionType.new('open')
end

Instance Method Details

#to_hashObject



16165
16166
16167
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16165

def to_hash
  value
end