Class: Io::Flow::V0::Models::CenterCapability
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::CenterCapability
- 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 CenterCapability for this value, creating a new instance for an unknown value.
- .commercial_invoice ⇒ Object
- .crossdock ⇒ Object
- .domestic ⇒ Object
-
.from_string(value) ⇒ Object
Returns the instance of CenterCapability for this value, or nil if not found.
- .international ⇒ Object
Instance Method Summary collapse
-
#initialize(value) ⇒ CenterCapability
constructor
A new instance of CenterCapability.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ CenterCapability
Returns a new instance of CenterCapability.
13106 13107 13108 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13106 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
13104 13105 13106 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13104 def value @value end |
Class Method Details
.ALL ⇒ Object
13126 13127 13128 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13126 def CenterCapability.ALL @@all ||= [CenterCapability.international, CenterCapability.domestic, CenterCapability.crossdock, CenterCapability.commercial_invoice] end |
.apply(value) ⇒ Object
Returns the instance of CenterCapability for this value, creating a new instance for an unknown value
13111 13112 13113 13114 13115 13116 13117 13118 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13111 def CenterCapability.apply(value) if value.instance_of?(CenterCapability) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || CenterCapability.new(value)) end end |
.commercial_invoice ⇒ Object
13142 13143 13144 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13142 def CenterCapability.commercial_invoice @@_commercial_invoice ||= CenterCapability.new('commercial_invoice') end |
.crossdock ⇒ Object
13138 13139 13140 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13138 def CenterCapability.crossdock @@_crossdock ||= CenterCapability.new('crossdock') end |
.domestic ⇒ Object
13134 13135 13136 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13134 def CenterCapability.domestic @@_domestic ||= CenterCapability.new('domestic') end |
.from_string(value) ⇒ Object
Returns the instance of CenterCapability for this value, or nil if not found
13121 13122 13123 13124 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13121 def CenterCapability.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) CenterCapability.ALL.find { |v| v.value == value } end |
.international ⇒ Object
13130 13131 13132 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13130 def CenterCapability.international @@_international ||= CenterCapability.new('international') end |
Instance Method Details
#to_hash ⇒ Object
13146 13147 13148 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13146 def to_hash value end |