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.



12612
12613
12614
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12612

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



12610
12611
12612
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12610

def value
  @value
end

Class Method Details

.ALLObject



12632
12633
12634
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12632

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



12617
12618
12619
12620
12621
12622
12623
12624
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12617

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



12657
12658
12659
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12657

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

.consumerObject

The party that placed an order



12637
12638
12639
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12637

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

.flowObject

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



12652
12653
12654
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12652

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



12627
12628
12629
12630
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12627

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



12647
12648
12649
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12647

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

.retailerObject

The party that owns the processing of the order



12642
12643
12644
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12642

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

Instance Method Details

#to_hashObject



12661
12662
12663
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12661

def to_hash
  value
end