Class: Io::Flow::V0::Models::UpdatePolicy
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::UpdatePolicy
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Class Method Summary collapse
- .ALL ⇒ Object
-
.apply(value) ⇒ Object
Returns the instance of UpdatePolicy for this value, creating a new instance for an unknown value.
- .auto ⇒ Object
- .discard ⇒ Object
-
.from_string(value) ⇒ Object
Returns the instance of UpdatePolicy for this value, or nil if not found.
-
.queue ⇒ Object
Queue item update for approval.
Instance Method Summary collapse
-
#initialize(value) ⇒ UpdatePolicy
constructor
A new instance of UpdatePolicy.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ UpdatePolicy
Returns a new instance of UpdatePolicy.
11282 11283 11284 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11282 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
11280 11281 11282 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11280 def value @value end |
Class Method Details
.ALL ⇒ Object
11302 11303 11304 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11302 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
11287 11288 11289 11290 11291 11292 11293 11294 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11287 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 |
.auto ⇒ Object
11306 11307 11308 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11306 def UpdatePolicy.auto @@_auto ||= UpdatePolicy.new('auto') end |
.discard ⇒ Object
11315 11316 11317 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11315 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
11297 11298 11299 11300 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11297 def UpdatePolicy.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) UpdatePolicy.ALL.find { |v| v.value == value } end |
.queue ⇒ Object
Queue item update for approval.
11311 11312 11313 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11311 def UpdatePolicy.queue @@_queue ||= UpdatePolicy.new('queue') end |
Instance Method Details
#to_hash ⇒ Object
11319 11320 11321 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11319 def to_hash value end |