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.
17087 17088 17089 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17087 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
17085 17086 17087 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17085 def value @value end |
Class Method Details
.ALL ⇒ Object
17107 17108 17109 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17107 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
17092 17093 17094 17095 17096 17097 17098 17099 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17092 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
17111 17112 17113 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17111 def UpdatePolicy.auto @@_auto ||= UpdatePolicy.new('auto') end |
.discard ⇒ Object
17120 17121 17122 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17120 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
17102 17103 17104 17105 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17102 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.
17116 17117 17118 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17116 def UpdatePolicy.queue @@_queue ||= UpdatePolicy.new('queue') end |
Instance Method Details
#to_hash ⇒ Object
17124 17125 17126 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17124 def to_hash value end |