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.



11006
11007
11008
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11006

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



11004
11005
11006
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11004

def value
  @value
end

Class Method Details

.ALLObject



11026
11027
11028
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11026

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



11011
11012
11013
11014
11015
11016
11017
11018
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11011

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



11030
11031
11032
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11030

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

.discardObject



11039
11040
11041
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11039

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



11021
11022
11023
11024
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11021

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.



11035
11036
11037
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11035

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

Instance Method Details

#to_hashObject



11043
11044
11045
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11043

def to_hash
  value
end