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.



15953
15954
15955
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15953

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



15951
15952
15953
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15951

def value
  @value
end

Class Method Details

.ALLObject



15973
15974
15975
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15973

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



15958
15959
15960
15961
15962
15963
15964
15965
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15958

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



15977
15978
15979
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15977

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

.discardObject



15986
15987
15988
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15986

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



15968
15969
15970
15971
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15968

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.



15982
15983
15984
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15982

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

Instance Method Details

#to_hashObject



15990
15991
15992
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15990

def to_hash
  value
end