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.



11810
11811
11812
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11810

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



11808
11809
11810
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11808

def value
  @value
end

Class Method Details

.ALLObject



11830
11831
11832
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11830

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



11815
11816
11817
11818
11819
11820
11821
11822
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11815

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



11834
11835
11836
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11834

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

.discardObject



11843
11844
11845
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11843

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



11825
11826
11827
11828
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11825

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.



11839
11840
11841
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11839

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

Instance Method Details

#to_hashObject



11847
11848
11849
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11847

def to_hash
  value
end