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.
11067 11068 11069 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11067 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
11065 11066 11067 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11065 def value @value end |
Class Method Details
.ALL ⇒ Object
11087 11088 11089 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11087 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
11072 11073 11074 11075 11076 11077 11078 11079 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11072 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
11103 11104 11105 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11103 def CenterCapability.commercial_invoice @@_commercial_invoice ||= CenterCapability.new('commercial_invoice') end |
.crossdock ⇒ Object
11099 11100 11101 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11099 def CenterCapability.crossdock @@_crossdock ||= CenterCapability.new('crossdock') end |
.domestic ⇒ Object
11095 11096 11097 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11095 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
11082 11083 11084 11085 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11082 def CenterCapability.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) CenterCapability.ALL.find { |v| v.value == value } end |
.international ⇒ Object
11091 11092 11093 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11091 def CenterCapability.international @@_international ||= CenterCapability.new('international') end |
Instance Method Details
#to_hash ⇒ Object
11107 11108 11109 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11107 def to_hash value end |