Class: Io::Flow::V0::Models::Capability
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::Capability
- 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 Capability for this value, creating a new instance for an unknown value.
- .crossdock ⇒ Object
-
.from_string(value) ⇒ Object
Returns the instance of Capability for this value, or nil if not found.
Instance Method Summary collapse
-
#initialize(value) ⇒ Capability
constructor
A new instance of Capability.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ Capability
Returns a new instance of Capability.
17491 17492 17493 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17491 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
17489 17490 17491 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17489 def value @value end |
Class Method Details
.ALL ⇒ Object
17511 17512 17513 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17511 def Capability.ALL @@all ||= [Capability.crossdock] end |
.apply(value) ⇒ Object
Returns the instance of Capability for this value, creating a new instance for an unknown value
17496 17497 17498 17499 17500 17501 17502 17503 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17496 def Capability.apply(value) if value.instance_of?(Capability) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || Capability.new(value)) end end |
.crossdock ⇒ Object
17515 17516 17517 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17515 def Capability.crossdock @@_crossdock ||= Capability.new('crossdock') end |
.from_string(value) ⇒ Object
Returns the instance of Capability for this value, or nil if not found
17506 17507 17508 17509 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17506 def Capability.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) Capability.ALL.find { |v| v.value == value } end |
Instance Method Details
#to_hash ⇒ Object
17519 17520 17521 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17519 def to_hash value end |