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.



13039
13040
13041
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13039

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



13037
13038
13039
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13037

def value
  @value
end

Class Method Details

.ALLObject



13059
13060
13061
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13059

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



13044
13045
13046
13047
13048
13049
13050
13051
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13044

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



13063
13064
13065
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13063

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

.discardObject



13072
13073
13074
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13072

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



13054
13055
13056
13057
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13054

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.



13068
13069
13070
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13068

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

Instance Method Details

#to_hashObject



13076
13077
13078
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13076

def to_hash
  value
end