Class: Io::Flow::V0::Models::CaptureDeclineCode
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::CaptureDeclineCode
- 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 CaptureDeclineCode for this value, creating a new instance for an unknown value.
-
.expired ⇒ Object
Payment authorization has expired.
-
.from_string(value) ⇒ Object
Returns the instance of CaptureDeclineCode for this value, or nil if not found.
-
.unknown ⇒ Object
Failed due to another reason (details not known).
Instance Method Summary collapse
-
#initialize(value) ⇒ CaptureDeclineCode
constructor
A new instance of CaptureDeclineCode.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ CaptureDeclineCode
Returns a new instance of CaptureDeclineCode.
4307 4308 4309 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4307 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
4305 4306 4307 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4305 def value @value end |
Class Method Details
.ALL ⇒ Object
4327 4328 4329 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4327 def CaptureDeclineCode.ALL @@all ||= [CaptureDeclineCode.expired, CaptureDeclineCode.unknown] end |
.apply(value) ⇒ Object
Returns the instance of CaptureDeclineCode for this value, creating a new instance for an unknown value
4312 4313 4314 4315 4316 4317 4318 4319 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4312 def CaptureDeclineCode.apply(value) if value.instance_of?(CaptureDeclineCode) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || CaptureDeclineCode.new(value)) end end |
.expired ⇒ Object
Payment authorization has expired
4332 4333 4334 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4332 def CaptureDeclineCode.expired @@_expired ||= CaptureDeclineCode.new('expired') end |
.from_string(value) ⇒ Object
Returns the instance of CaptureDeclineCode for this value, or nil if not found
4322 4323 4324 4325 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4322 def CaptureDeclineCode.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) CaptureDeclineCode.ALL.find { |v| v.value == value } end |
.unknown ⇒ Object
Failed due to another reason (details not known)
4337 4338 4339 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4337 def CaptureDeclineCode.unknown @@_unknown ||= CaptureDeclineCode.new('unknown') end |
Instance Method Details
#to_hash ⇒ Object
4341 4342 4343 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4341 def to_hash value end |