Class: Io::Flow::V0::Models::OrderChangeSource

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

Returns a new instance of OrderChangeSource.



10841
10842
10843
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10841

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



10839
10840
10841
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10839

def value
  @value
end

Class Method Details

.ALLObject



10861
10862
10863
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10861

def OrderChangeSource.ALL
  @@all ||= [OrderChangeSource.consumer, OrderChangeSource.retailer, OrderChangeSource.fulfillment, OrderChangeSource.flow, OrderChangeSource.carrier]
end

.apply(value) ⇒ Object

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



10846
10847
10848
10849
10850
10851
10852
10853
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10846

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

.carrierObject

A party providing carriage for an order



10886
10887
10888
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10886

def OrderChangeSource.carrier
  @@_carrier ||= OrderChangeSource.new('carrier')
end

.consumerObject

The party that placed an order



10866
10867
10868
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10866

def OrderChangeSource.consumer
  @@_consumer ||= OrderChangeSource.new('consumer')
end

.flowObject

Flow may provide anti-fraud or payment services for an order



10881
10882
10883
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10881

def OrderChangeSource.flow
  @@_flow ||= OrderChangeSource.new('flow')
end

.from_string(value) ⇒ Object

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



10856
10857
10858
10859
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10856

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

.fulfillmentObject

A party providing fulfillment for an order



10876
10877
10878
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10876

def OrderChangeSource.fulfillment
  @@_fulfillment ||= OrderChangeSource.new('fulfillment')
end

.retailerObject

The party that owns the processing of the order



10871
10872
10873
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10871

def OrderChangeSource.retailer
  @@_retailer ||= OrderChangeSource.new('retailer')
end

Instance Method Details

#to_hashObject



10890
10891
10892
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10890

def to_hash
  value
end