Class: Io::Flow::V0::Models::QuoteErrorCode

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) ⇒ QuoteErrorCode

Returns a new instance of QuoteErrorCode.



8040
8041
8042
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8040

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



8038
8039
8040
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8038

def value
  @value
end

Class Method Details

.ALLObject



8060
8061
8062
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8060

def QuoteErrorCode.ALL
  @@all ||= [QuoteErrorCode.generic_error, QuoteErrorCode.items_not_available]
end

.apply(value) ⇒ Object

Returns the instance of QuoteErrorCode for this value, creating a new instance for an unknown value



8045
8046
8047
8048
8049
8050
8051
8052
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8045

def QuoteErrorCode.apply(value)
  if value.instance_of?(QuoteErrorCode)
    value
  else
    HttpClient::Preconditions.assert_class_or_nil('value', value, String)
    value.nil? ? nil : (from_string(value) || QuoteErrorCode.new(value))
  end
end

.from_string(value) ⇒ Object

Returns the instance of QuoteErrorCode for this value, or nil if not found



8055
8056
8057
8058
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8055

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

.generic_errorObject



8064
8065
8066
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8064

def QuoteErrorCode.generic_error
  @@_generic_error ||= QuoteErrorCode.new('generic_error')
end

.items_not_availableObject

Item numbers are not available in inventory



8069
8070
8071
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8069

def QuoteErrorCode.items_not_available
  @@_items_not_available ||= QuoteErrorCode.new('items_not_available')
end

Instance Method Details

#to_hashObject



8073
8074
8075
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8073

def to_hash
  value
end