Class: Io::Flow::V0::Models::LogisticsFormat
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::LogisticsFormat
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#preference ⇒ Object
readonly
Returns the value of attribute preference.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ LogisticsFormat
constructor
A new instance of LogisticsFormat.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ LogisticsFormat
Returns a new instance of LogisticsFormat.
49321 49322 49323 49324 49325 49326 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49321 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:preference], 'LogisticsFormat') @preference = (x = opts.delete(:preference); x.is_a?(::Io::Flow::V0::Models::LogisticsFormatPreference) ? x : ::Io::Flow::V0::Models::LogisticsFormatPreference.apply(x)) @description = (x = opts.delete(:description); x.nil? ? nil : HttpClient::Preconditions.assert_class('description', x, String)) end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
49319 49320 49321 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49319 def description @description end |
#preference ⇒ Object (readonly)
Returns the value of attribute preference.
49319 49320 49321 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49319 def preference @preference end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
49332 49333 49334 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49332 def copy(incoming={}) LogisticsFormat.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
49336 49337 49338 49339 49340 49341 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49336 def to_hash { :preference => preference.value, :description => description } end |
#to_json ⇒ Object
49328 49329 49330 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49328 def to_json JSON.dump(to_hash) end |