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.



11874
11875
11876
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11874

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



11872
11873
11874
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11872

def value
  @value
end

Class Method Details

.ALLObject



11894
11895
11896
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11894

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



11879
11880
11881
11882
11883
11884
11885
11886
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11879

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



11898
11899
11900
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11898

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

.discardObject



11907
11908
11909
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11907

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



11889
11890
11891
11892
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11889

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.



11903
11904
11905
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11903

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

Instance Method Details

#to_hashObject



11911
11912
11913
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11911

def to_hash
  value
end