Class: Chairman::Holmes::Client
- Inherits:
-
Object
- Object
- Chairman::Holmes::Client
- Defined in:
- lib/chairman/holmes.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#headers ⇒ Object
Returns the value of attribute headers.
Instance Method Summary collapse
- #extensions ⇒ Object
-
#initialize(host) ⇒ Client
constructor
A new instance of Client.
- #root ⇒ Object
Constructor Details
#initialize(host) ⇒ Client
9 10 11 12 13 14 15 16 |
# File 'lib/chairman/holmes.rb', line 9 def initialize(host) @api_client = Sawyer::Agent.new(host, {serializer: Sawyer::Serializer.yajl}) do |http| http.headers['content-type'] = 'application/json' end @headers = {} @body = '' end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
7 8 9 |
# File 'lib/chairman/holmes.rb', line 7 def body @body end |
#headers ⇒ Object
Returns the value of attribute headers.
7 8 9 |
# File 'lib/chairman/holmes.rb', line 7 def headers @headers end |
Instance Method Details
#extensions ⇒ Object
22 23 24 |
# File 'lib/chairman/holmes.rb', line 22 def extensions get '/extensions' end |
#root ⇒ Object
18 19 20 |
# File 'lib/chairman/holmes.rb', line 18 def root get '/' end |