Class: Io::Flow::V0::Models::ServiceSummary
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::ServiceSummary
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#carrier ⇒ Object
readonly
Returns the value of attribute carrier.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ ServiceSummary
constructor
A new instance of ServiceSummary.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ ServiceSummary
Returns a new instance of ServiceSummary.
26382 26383 26384 26385 26386 26387 26388 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26382 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:id, :carrier, :name], 'ServiceSummary') @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String) @carrier = (x = opts.delete(:carrier); x.is_a?(::Io::Flow::V0::Models::CarrierReference) ? x : ::Io::Flow::V0::Models::CarrierReference.new(x)) @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String) end |
Instance Attribute Details
#carrier ⇒ Object (readonly)
Returns the value of attribute carrier.
26380 26381 26382 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26380 def carrier @carrier end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
26380 26381 26382 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26380 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
26380 26381 26382 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26380 def name @name end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
26394 26395 26396 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26394 def copy(incoming={}) ServiceSummary.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
26398 26399 26400 26401 26402 26403 26404 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26398 def to_hash { :id => id, :carrier => carrier.to_hash, :name => name } end |
#to_json ⇒ Object
26390 26391 26392 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26390 def to_json JSON.dump(to_hash) end |