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.
26098 26099 26100 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26098 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
26096 26097 26098 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26096 def value @value end |
Class Method Details
.ALL ⇒ Object
26118 26119 26120 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26118 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
26103 26104 26105 26106 26107 26108 26109 26110 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26103 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
26122 26123 26124 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26122 def UpdatePolicy.auto @@_auto ||= UpdatePolicy.new('auto') end |
.discard ⇒ Object
26131 26132 26133 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26131 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
26113 26114 26115 26116 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26113 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.
26127 26128 26129 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26127 def UpdatePolicy.queue @@_queue ||= UpdatePolicy.new('queue') end |
Instance Method Details
#to_hash ⇒ Object
26135 26136 26137 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26135 def to_hash value end |