Class: Io::Flow::V0::Models::AvailableService
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::AvailableService
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Representation of a service level available at a center, including misc attributes. Only ID for now, more attributes will be added in the future.
Instance Attribute Summary collapse
-
#service ⇒ Object
readonly
Returns the value of attribute service.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ AvailableService
constructor
A new instance of AvailableService.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ AvailableService
Returns a new instance of AvailableService.
6330 6331 6332 6333 6334 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6330 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:service], 'AvailableService') @service = HttpClient::Preconditions.assert_class('service', opts.delete(:service), String) end |
Instance Attribute Details
#service ⇒ Object (readonly)
Returns the value of attribute service.
6328 6329 6330 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6328 def service @service end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
6340 6341 6342 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6340 def copy(incoming={}) AvailableService.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
6344 6345 6346 6347 6348 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6344 def to_hash { :service => service } end |
#to_json ⇒ Object
6336 6337 6338 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6336 def to_json JSON.dump(to_hash) end |