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.



15274
15275
15276
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15274

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



15272
15273
15274
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15272

def value
  @value
end

Class Method Details

.ALLObject



15294
15295
15296
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15294

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



15279
15280
15281
15282
15283
15284
15285
15286
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15279

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



15302
15303
15304
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15302

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



15289
15290
15291
15292
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15289

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

.openObject



15298
15299
15300
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15298

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

Instance Method Details

#to_hashObject



15306
15307
15308
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15306

def to_hash
  value
end