Class: Io::Flow::V0::Models::ReturnStatus

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

Returns a new instance of ReturnStatus.



12013
12014
12015
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12013

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



12011
12012
12013
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12011

def value
  @value
end

Class Method Details

.ALLObject



12033
12034
12035
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12033

def ReturnStatus.ALL
  @@all ||= [ReturnStatus.open, ReturnStatus.refunded]
end

.apply(value) ⇒ Object

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



12018
12019
12020
12021
12022
12023
12024
12025
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12018

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

.from_string(value) ⇒ Object

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



12028
12029
12030
12031
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12028

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

.openObject



12037
12038
12039
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12037

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

.refundedObject



12041
12042
12043
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12041

def ReturnStatus.refunded
  @@_refunded ||= ReturnStatus.new('refunded')
end

Instance Method Details

#to_hashObject



12045
12046
12047
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12045

def to_hash
  value
end