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.



9524
9525
9526
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9524

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



9522
9523
9524
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9522

def value
  @value
end

Class Method Details

.ALLObject



9544
9545
9546
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9544

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



9529
9530
9531
9532
9533
9534
9535
9536
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9529

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



9548
9549
9550
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9548

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

.discardObject



9557
9558
9559
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9557

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



9539
9540
9541
9542
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9539

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.



9553
9554
9555
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9553

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

Instance Method Details

#to_hashObject



9561
9562
9563
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9561

def to_hash
  value
end