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.



28237
28238
28239
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28237

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



28235
28236
28237
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28235

def value
  @value
end

Class Method Details

.ALLObject



28257
28258
28259
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28257

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



28242
28243
28244
28245
28246
28247
28248
28249
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28242

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



28261
28262
28263
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28261

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

.discardObject



28270
28271
28272
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28270

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



28252
28253
28254
28255
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28252

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.



28266
28267
28268
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28266

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

Instance Method Details

#to_hashObject



28274
28275
28276
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28274

def to_hash
  value
end