Class: Io::Flow::V0::Models::ServiceSummary
- Inherits:
-
ServiceDescription
- Object
- ServiceDescription
- 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.
Attributes inherited from ServiceDescription
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ ServiceSummary
constructor
A new instance of ServiceSummary.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from ServiceDescription
Constructor Details
#initialize(incoming = {}) ⇒ ServiceSummary
Returns a new instance of ServiceSummary.
65199 65200 65201 65202 65203 65204 65205 65206 65207 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 65199 def initialize(incoming={}) super(:discriminator => ServiceDescription::Types::SERVICE_SUMMARY) 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.
65197 65198 65199 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 65197 def carrier @carrier end |
#center_code ⇒ Object (readonly)
Returns the value of attribute center_code.
65197 65198 65199 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 65197 def center_code @center_code end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
65197 65198 65199 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 65197 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
65197 65198 65199 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 65197 def name @name end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
65213 65214 65215 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 65213 def copy(incoming={}) ServiceSummary.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
65217 65218 65219 65220 65221 65222 65223 65224 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 65217 def subtype_to_hash { :id => id, :carrier => carrier.to_hash, :name => name, :center_code => center_code } end |
#to_json ⇒ Object
65209 65210 65211 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 65209 def to_json JSON.dump(to_hash) end |