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.
16980 16981 16982 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16980 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
16978 16979 16980 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16978 def value @value end |
Class Method Details
.ALL ⇒ Object
17000 17001 17002 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17000 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
16985 16986 16987 16988 16989 16990 16991 16992 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16985 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
17004 17005 17006 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17004 def UpdatePolicy.auto @@_auto ||= UpdatePolicy.new('auto') end |
.discard ⇒ Object
17013 17014 17015 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17013 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
16995 16996 16997 16998 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16995 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.
17009 17010 17011 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17009 def UpdatePolicy.queue @@_queue ||= UpdatePolicy.new('queue') end |
Instance Method Details
#to_hash ⇒ Object
17017 17018 17019 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17017 def to_hash value end |