Class: Io::Flow::V0::Models::ReturnPolicyState

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

Returns a new instance of ReturnPolicyState.



23906
23907
23908
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23906

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



23904
23905
23906
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23904

def value
  @value
end

Class Method Details

.ALLObject



23926
23927
23928
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23926

def ReturnPolicyState.ALL
  @@all ||= [ReturnPolicyState.current, ReturnPolicyState.deleting, ReturnPolicyState.updating]
end

.apply(value) ⇒ Object

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



23911
23912
23913
23914
23915
23916
23917
23918
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23911

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

.currentObject



23930
23931
23932
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23930

def ReturnPolicyState.current
  @@_current ||= ReturnPolicyState.new('current')
end

.deletingObject



23934
23935
23936
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23934

def ReturnPolicyState.deleting
  @@_deleting ||= ReturnPolicyState.new('deleting')
end

.from_string(value) ⇒ Object

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



23921
23922
23923
23924
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23921

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

.updatingObject



23938
23939
23940
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23938

def ReturnPolicyState.updating
  @@_updating ||= ReturnPolicyState.new('updating')
end

Instance Method Details

#to_hashObject



23942
23943
23944
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23942

def to_hash
  value
end