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.



9884
9885
9886
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9884

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



9882
9883
9884
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9882

def value
  @value
end

Class Method Details

.ALLObject



9904
9905
9906
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9904

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



9889
9890
9891
9892
9893
9894
9895
9896
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9889

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



9899
9900
9901
9902
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9899

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

.openObject



9908
9909
9910
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9908

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

.refundedObject



9912
9913
9914
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9912

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

Instance Method Details

#to_hashObject



9916
9917
9918
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9916

def to_hash
  value
end