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.



20602
20603
20604
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20602

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



20600
20601
20602
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20600

def value
  @value
end

Class Method Details

.ALLObject



20622
20623
20624
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20622

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



20607
20608
20609
20610
20611
20612
20613
20614
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20607

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



20626
20627
20628
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20626

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

.discardObject



20635
20636
20637
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20635

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



20617
20618
20619
20620
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20617

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.



20631
20632
20633
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20631

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

Instance Method Details

#to_hashObject



20639
20640
20641
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20639

def to_hash
  value
end