Class: Io::Flow::V0::Models::ReturnItemStatus

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

Returns a new instance of ReturnItemStatus.



25907
25908
25909
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25907

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



25905
25906
25907
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25905

def value
  @value
end

Class Method Details

.ALLObject



25927
25928
25929
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25927

def ReturnItemStatus.ALL
  @@all ||= [ReturnItemStatus.returnable, ReturnItemStatus.non_returnable]
end

.apply(value) ⇒ Object

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



25912
25913
25914
25915
25916
25917
25918
25919
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25912

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

.from_string(value) ⇒ Object

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



25922
25923
25924
25925
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25922

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

.non_returnableObject

The item in the catalog cannot be returned



25937
25938
25939
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25937

def ReturnItemStatus.non_returnable
  @@_non_returnable ||= ReturnItemStatus.new('non-returnable')
end

.returnableObject

The item in the catalog can be returned



25932
25933
25934
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25932

def ReturnItemStatus.returnable
  @@_returnable ||= ReturnItemStatus.new('returnable')
end

Instance Method Details

#to_hashObject



25941
25942
25943
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25941

def to_hash
  value
end