Class: Io::Flow::V0::Models::MerchantGiftCardErrorCode
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::MerchantGiftCardErrorCode
- 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 MerchantGiftCardErrorCode for this value, creating a new instance for an unknown value.
-
.empty ⇒ Object
Balance is 0.
- .expired ⇒ Object
-
.from_string(value) ⇒ Object
Returns the instance of MerchantGiftCardErrorCode for this value, or nil if not found.
-
.insufficient_funds ⇒ Object
Redemption amount greater than balance.
-
.invalid ⇒ Object
Generic error type.
-
.unsupported_currency ⇒ Object
Redemption or reversal currency is not supported.
Instance Method Summary collapse
-
#initialize(value) ⇒ MerchantGiftCardErrorCode
constructor
A new instance of MerchantGiftCardErrorCode.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ MerchantGiftCardErrorCode
Returns a new instance of MerchantGiftCardErrorCode.
19908 19909 19910 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19908 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
19906 19907 19908 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19906 def value @value end |
Class Method Details
.ALL ⇒ Object
19928 19929 19930 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19928 def MerchantGiftCardErrorCode.ALL @@all ||= [MerchantGiftCardErrorCode.invalid, MerchantGiftCardErrorCode.expired, MerchantGiftCardErrorCode.empty, MerchantGiftCardErrorCode.insufficient_funds, MerchantGiftCardErrorCode.unsupported_currency] end |
.apply(value) ⇒ Object
Returns the instance of MerchantGiftCardErrorCode for this value, creating a new instance for an unknown value
19913 19914 19915 19916 19917 19918 19919 19920 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19913 def MerchantGiftCardErrorCode.apply(value) if value.instance_of?(MerchantGiftCardErrorCode) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || MerchantGiftCardErrorCode.new(value)) end end |
.empty ⇒ Object
Balance is 0
19942 19943 19944 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19942 def MerchantGiftCardErrorCode.empty @@_empty ||= MerchantGiftCardErrorCode.new('empty') end |
.expired ⇒ Object
19937 19938 19939 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19937 def MerchantGiftCardErrorCode.expired @@_expired ||= MerchantGiftCardErrorCode.new('expired') end |
.from_string(value) ⇒ Object
Returns the instance of MerchantGiftCardErrorCode for this value, or nil if not found
19923 19924 19925 19926 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19923 def MerchantGiftCardErrorCode.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) MerchantGiftCardErrorCode.ALL.find { |v| v.value == value } end |
.insufficient_funds ⇒ Object
Redemption amount greater than balance
19947 19948 19949 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19947 def MerchantGiftCardErrorCode.insufficient_funds @@_insufficient_funds ||= MerchantGiftCardErrorCode.new('insufficient_funds') end |
.invalid ⇒ Object
Generic error type
19933 19934 19935 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19933 def MerchantGiftCardErrorCode.invalid @@_invalid ||= MerchantGiftCardErrorCode.new('invalid') end |
.unsupported_currency ⇒ Object
Redemption or reversal currency is not supported
19952 19953 19954 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19952 def MerchantGiftCardErrorCode.unsupported_currency @@_unsupported_currency ||= MerchantGiftCardErrorCode.new('unsupported_currency') end |
Instance Method Details
#to_hash ⇒ Object
19956 19957 19958 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19956 def to_hash value end |