Class: Io::Flow::V0::Models::ChangeType
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::ChangeType
- 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 ChangeType for this value, creating a new instance for an unknown value.
- .delete ⇒ Object
-
.from_string(value) ⇒ Object
Returns the instance of ChangeType for this value, or nil if not found.
- .insert ⇒ Object
- .update ⇒ Object
Instance Method Summary collapse
-
#initialize(value) ⇒ ChangeType
constructor
A new instance of ChangeType.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ ChangeType
Returns a new instance of ChangeType.
7689 7690 7691 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7689 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
7687 7688 7689 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7687 def value @value end |
Class Method Details
.ALL ⇒ Object
7709 7710 7711 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7709 def ChangeType.ALL @@all ||= [ChangeType.insert, ChangeType.update, ChangeType.delete] end |
.apply(value) ⇒ Object
Returns the instance of ChangeType for this value, creating a new instance for an unknown value
7694 7695 7696 7697 7698 7699 7700 7701 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7694 def ChangeType.apply(value) if value.instance_of?(ChangeType) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || ChangeType.new(value)) end end |
.delete ⇒ Object
7721 7722 7723 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7721 def ChangeType.delete @@_delete ||= ChangeType.new('delete') end |
.from_string(value) ⇒ Object
Returns the instance of ChangeType for this value, or nil if not found
7704 7705 7706 7707 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7704 def ChangeType.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) ChangeType.ALL.find { |v| v.value == value } end |
.insert ⇒ Object
7713 7714 7715 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7713 def ChangeType.insert @@_insert ||= ChangeType.new('insert') end |
.update ⇒ Object
7717 7718 7719 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7717 def ChangeType.update @@_update ||= ChangeType.new('update') end |
Instance Method Details
#to_hash ⇒ Object
7725 7726 7727 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7725 def to_hash value end |