Class: Io::Flow::V0::Models::UpdatePolicy

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

Returns a new instance of UpdatePolicy.



8806
8807
8808
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8806

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



8804
8805
8806
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8804

def value
  @value
end

Class Method Details

.ALLObject



8826
8827
8828
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8826

def UpdatePolicy.ALL
  @@all ||= [UpdatePolicy.auto, UpdatePolicy.queue, UpdatePolicy.discard]
end

.apply(value) ⇒ Object

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



8811
8812
8813
8814
8815
8816
8817
8818
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8811

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

.autoObject



8830
8831
8832
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8830

def UpdatePolicy.auto
  @@_auto ||= UpdatePolicy.new('auto')
end

.discardObject



8839
8840
8841
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8839

def UpdatePolicy.discard
  @@_discard ||= UpdatePolicy.new('discard')
end

.from_string(value) ⇒ Object

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



8821
8822
8823
8824
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8821

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

.queueObject

Queue item update for approval.



8835
8836
8837
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8835

def UpdatePolicy.queue
  @@_queue ||= UpdatePolicy.new('queue')
end

Instance Method Details

#to_hashObject



8843
8844
8845
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8843

def to_hash
  value
end