class Io::Flow::V0::Models::Environment
Attributes
value[R]
Public Class Methods
ALL()
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 19273 def Environment.ALL @@all ||= [Environment.sandbox, Environment.production] end
apply(value)
click to toggle source
Returns the instance of Environment
for this value, creating a new instance for an unknown value
# File lib/flow_commerce/flow_api_v0_client.rb, line 19258 def Environment.apply(value) if value.instance_of?(Environment) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || Environment.new(value)) end end
from_string(value)
click to toggle source
Returns the instance of Environment
for this value, or nil if not found
# File lib/flow_commerce/flow_api_v0_client.rb, line 19268 def Environment.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) Environment.ALL.find { |v| v.value == value } end
new(value)
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 19253 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end
production()
click to toggle source
In production, all external services are live and will generate real transactions
# File lib/flow_commerce/flow_api_v0_client.rb, line 19285 def Environment.production @@_production ||= Environment.new('production') end
sandbox()
click to toggle source
In sandbox, no external services (e.g. orders, payments, logistics) will generate real transactions
# File lib/flow_commerce/flow_api_v0_client.rb, line 19279 def Environment.sandbox @@_sandbox ||= Environment.new('sandbox') end
Public Instance Methods
to_hash()
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 19289 def to_hash value end