Class: Io::Flow::V0::Models::WebhookStatus
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::WebhookStatus
- 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 WebhookStatus for this value, creating a new instance for an unknown value.
- .failure ⇒ Object
-
.from_string(value) ⇒ Object
Returns the instance of WebhookStatus for this value, or nil if not found.
- .pending ⇒ Object
- .success ⇒ Object
Instance Method Summary collapse
-
#initialize(value) ⇒ WebhookStatus
constructor
A new instance of WebhookStatus.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ WebhookStatus
Returns a new instance of WebhookStatus.
21345 21346 21347 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21345 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
21343 21344 21345 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21343 def value @value end |
Class Method Details
.ALL ⇒ Object
21365 21366 21367 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21365 def WebhookStatus.ALL @@all ||= [WebhookStatus.pending, WebhookStatus.success, WebhookStatus.failure] end |
.apply(value) ⇒ Object
Returns the instance of WebhookStatus for this value, creating a new instance for an unknown value
21350 21351 21352 21353 21354 21355 21356 21357 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21350 def WebhookStatus.apply(value) if value.instance_of?(WebhookStatus) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || WebhookStatus.new(value)) end end |
.failure ⇒ Object
21377 21378 21379 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21377 def WebhookStatus.failure @@_failure ||= WebhookStatus.new('failure') end |
.from_string(value) ⇒ Object
Returns the instance of WebhookStatus for this value, or nil if not found
21360 21361 21362 21363 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21360 def WebhookStatus.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) WebhookStatus.ALL.find { |v| v.value == value } end |
.pending ⇒ Object
21369 21370 21371 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21369 def WebhookStatus.pending @@_pending ||= WebhookStatus.new('pending') end |
.success ⇒ Object
21373 21374 21375 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21373 def WebhookStatus.success @@_success ||= WebhookStatus.new('success') end |
Instance Method Details
#to_hash ⇒ Object
21381 21382 21383 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21381 def to_hash value end |