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.
10721 10722 10723 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10721 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
10719 10720 10721 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10719 def value @value end |
Class Method Details
.ALL ⇒ Object
10741 10742 10743 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10741 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
10726 10727 10728 10729 10730 10731 10732 10733 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10726 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
10745 10746 10747 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10745 def UpdatePolicy.auto @@_auto ||= UpdatePolicy.new('auto') end |
.discard ⇒ Object
10754 10755 10756 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10754 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
10736 10737 10738 10739 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10736 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.
10750 10751 10752 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10750 def UpdatePolicy.queue @@_queue ||= UpdatePolicy.new('queue') end |
Instance Method Details
#to_hash ⇒ Object
10758 10759 10760 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10758 def to_hash value end |