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.
-
#center_code ⇒ Object
readonly
Returns the value of attribute center_code.
-
#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.
49634 49635 49636 49637 49638 49639 49640 49641 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49634 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) @center_code = (x = opts.delete(:center_code); x.nil? ? nil : HttpClient::Preconditions.assert_class('center_code', x, String)) end |
Instance Attribute Details
#carrier ⇒ Object (readonly)
Returns the value of attribute carrier.
49632 49633 49634 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49632 def carrier @carrier end |
#center_code ⇒ Object (readonly)
Returns the value of attribute center_code.
49632 49633 49634 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49632 def center_code @center_code end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
49632 49633 49634 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49632 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
49632 49633 49634 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49632 def name @name end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
49647 49648 49649 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49647 def copy(incoming={}) ServiceSummary.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
49651 49652 49653 49654 49655 49656 49657 49658 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49651 def to_hash { :id => id, :carrier => carrier.to_hash, :name => name, :center_code => center_code } end |
#to_json ⇒ Object
49643 49644 49645 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49643 def to_json JSON.dump(to_hash) end |