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.



14941
14942
14943
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14941

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



14939
14940
14941
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14939

def value
  @value
end

Class Method Details

.ALLObject



14961
14962
14963
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14961

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



14946
14947
14948
14949
14950
14951
14952
14953
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14946

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



14969
14970
14971
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14969

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



14956
14957
14958
14959
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14956

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

.openObject



14965
14966
14967
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14965

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

Instance Method Details

#to_hashObject



14973
14974
14975
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14973

def to_hash
  value
end