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.



21216
21217
21218
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21216

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



21214
21215
21216
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21214

def value
  @value
end

Class Method Details

.ALLObject



21236
21237
21238
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21236

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



21221
21222
21223
21224
21225
21226
21227
21228
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21221

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



21240
21241
21242
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21240

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

.discardObject



21249
21250
21251
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21249

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



21231
21232
21233
21234
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21231

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.



21245
21246
21247
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21245

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

Instance Method Details

#to_hashObject



21253
21254
21255
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21253

def to_hash
  value
end