Class: WCC::Data::Service
- Inherits:
-
Object
- Object
- WCC::Data::Service
- Defined in:
- lib/wcc/data/service.rb
Constant Summary collapse
- VERBS =
Set.new(i[get post put patch delete])
Instance Attribute Summary collapse
-
#connection ⇒ Object
readonly
Returns the value of attribute connection.
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ Service
constructor
A new instance of Service.
- #merge(arg = nil) ⇒ Object
Constructor Details
#initialize(args = {}) ⇒ Service
Returns a new instance of Service.
7 8 9 10 |
# File 'lib/wcc/data/service.rb', line 7 def initialize(args={}) @uri = URI(args.fetch(:uri) { "" }) @connection = args.fetch(:connection) { nil } end |
Instance Attribute Details
#connection ⇒ Object (readonly)
Returns the value of attribute connection.
3 4 5 |
# File 'lib/wcc/data/service.rb', line 3 def connection @connection end |
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
3 4 5 |
# File 'lib/wcc/data/service.rb', line 3 def uri @uri end |
Instance Method Details
#merge(arg = nil) ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/wcc/data/service.rb', line 12 def merge(arg=nil) right = WCC::Data.Service(arg) self.class.new( uri: merge_uris(uri, right.uri), connection: right.connection || connection ) end |