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.



19963
19964
19965
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19963

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



19961
19962
19963
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19961

def value
  @value
end

Class Method Details

.ALLObject



19983
19984
19985
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19983

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



19968
19969
19970
19971
19972
19973
19974
19975
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19968

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



19987
19988
19989
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19987

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

.discardObject



19996
19997
19998
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19996

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



19978
19979
19980
19981
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19978

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.



19992
19993
19994
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19992

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

Instance Method Details

#to_hashObject



20000
20001
20002
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20000

def to_hash
  value
end