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.
11229 11230 11231 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11229 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
11227 11228 11229 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11227 def value @value end |
Class Method Details
.ALL ⇒ Object
11249 11250 11251 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11249 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
11234 11235 11236 11237 11238 11239 11240 11241 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11234 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
11261 11262 11263 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11261 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
11244 11245 11246 11247 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11244 def WebhookStatus.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) WebhookStatus.ALL.find { |v| v.value == value } end |
.pending ⇒ Object
11253 11254 11255 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11253 def WebhookStatus.pending @@_pending ||= WebhookStatus.new('pending') end |
.success ⇒ Object
11257 11258 11259 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11257 def WebhookStatus.success @@_success ||= WebhookStatus.new('success') end |
Instance Method Details
#to_hash ⇒ Object
11265 11266 11267 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11265 def to_hash value end |