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.



19970
19971
19972
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19970

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



19968
19969
19970
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19968

def value
  @value
end

Class Method Details

.ALLObject



19990
19991
19992
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19990

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



19975
19976
19977
19978
19979
19980
19981
19982
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19975

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



19985
19986
19987
19988
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19985

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



20000
20001
20002
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20000

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

.returnableObject

The item in the catalog can be returned



19995
19996
19997
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19995

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

Instance Method Details

#to_hashObject



20004
20005
20006
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20004

def to_hash
  value
end