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.
19142 19143 19144 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19142 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
19140 19141 19142 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19140 def value @value end |
Class Method Details
.ALL ⇒ Object
19162 19163 19164 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19162 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
19147 19148 19149 19150 19151 19152 19153 19154 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19147 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
19166 19167 19168 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19166 def UpdatePolicy.auto @@_auto ||= UpdatePolicy.new('auto') end |
.discard ⇒ Object
19175 19176 19177 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19175 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
19157 19158 19159 19160 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19157 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.
19171 19172 19173 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19171 def UpdatePolicy.queue @@_queue ||= UpdatePolicy.new('queue') end |
Instance Method Details
#to_hash ⇒ Object
19179 19180 19181 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19179 def to_hash value end |