Class: Io::Flow::V0::Models::ReturnStatus
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::ReturnStatus
- 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 ReturnStatus for this value, creating a new instance for an unknown value.
-
.from_string(value) ⇒ Object
Returns the instance of ReturnStatus for this value, or nil if not found.
- .open ⇒ Object
- .refunded ⇒ Object
Instance Method Summary collapse
-
#initialize(value) ⇒ ReturnStatus
constructor
A new instance of ReturnStatus.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ ReturnStatus
Returns a new instance of ReturnStatus.
23952 23953 23954 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23952 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
23950 23951 23952 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23950 def value @value end |
Class Method Details
.ALL ⇒ Object
23972 23973 23974 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23972 def ReturnStatus.ALL @@all ||= [ReturnStatus.open, ReturnStatus.refunded] end |
.apply(value) ⇒ Object
Returns the instance of ReturnStatus for this value, creating a new instance for an unknown value
23957 23958 23959 23960 23961 23962 23963 23964 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23957 def ReturnStatus.apply(value) if value.instance_of?(ReturnStatus) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || ReturnStatus.new(value)) end end |
.from_string(value) ⇒ Object
Returns the instance of ReturnStatus for this value, or nil if not found
23967 23968 23969 23970 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23967 def ReturnStatus.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) ReturnStatus.ALL.find { |v| v.value == value } end |
.open ⇒ Object
23976 23977 23978 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23976 def ReturnStatus.open @@_open ||= ReturnStatus.new('open') end |
.refunded ⇒ Object
23980 23981 23982 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23980 def ReturnStatus.refunded @@_refunded ||= ReturnStatus.new('refunded') end |
Instance Method Details
#to_hash ⇒ Object
23984 23985 23986 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23984 def to_hash value end |