Class: Io::Flow::V0::Models::FulfillmentItemQuantityStatus

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

Returns a new instance of FulfillmentItemQuantityStatus.



10057
10058
10059
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10057

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



10055
10056
10057
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10055

def value
  @value
end

Class Method Details

.ALLObject



10077
10078
10079
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10077

def FulfillmentItemQuantityStatus.ALL
  @@all ||= [FulfillmentItemQuantityStatus.new, FulfillmentItemQuantityStatus.shipped, FulfillmentItemQuantityStatus.cancelled]
end

.apply(value) ⇒ Object

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



10062
10063
10064
10065
10066
10067
10068
10069
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10062

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

.cancelledObject

Item will not be fulfilled.



10092
10093
10094
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10092

def FulfillmentItemQuantityStatus.cancelled
  @@_cancelled ||= FulfillmentItemQuantityStatus.new('cancelled')
end

.from_string(value) ⇒ Object

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



10072
10073
10074
10075
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10072

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

.newObject

Item may be shipped or cancelled



10082
10083
10084
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10082

def FulfillmentItemQuantityStatus.new
  @@_new ||= FulfillmentItemQuantityStatus.new('new')
end

.shippedObject

Item has been packaged for shipment; can no longer be cancelled.



10087
10088
10089
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10087

def FulfillmentItemQuantityStatus.shipped
  @@_shipped ||= FulfillmentItemQuantityStatus.new('shipped')
end

Instance Method Details

#to_hashObject



10096
10097
10098
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10096

def to_hash
  value
end