Class: Service::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/service-client.rb,
lib/service-client/error.rb,
lib/service-client/version.rb,
lib/service-client/raw_interface.rb

Defined Under Namespace

Modules: BaseResponse Classes: Adapter, BoundRoute, Error, RawInterface, Redirection, Response, ResponseError, Route, RouteCollection, RoutingError, ServiceError, UrlPattern

Constant Summary collapse

VERSION =
"0.0.14"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(base_url) ⇒ Client

Returns a new instance of Client.



23
24
25
# File 'lib/service-client.rb', line 23

def initialize(base_url)
  @base_url = base_url
end

Instance Attribute Details

#base_urlObject (readonly)

Returns the value of attribute base_url.



21
22
23
# File 'lib/service-client.rb', line 21

def base_url
  @base_url
end

Instance Method Details

#delete(bound_route, token, body_hash = nil) ⇒ Object



48
49
50
# File 'lib/service-client.rb', line 48

def delete(bound_route, token, body_hash = nil)
  request(:delete, token, bound_route, body_hash)
end

#get(bound_route, token, body_hash = nil) ⇒ Object



36
37
38
# File 'lib/service-client.rb', line 36

def get(bound_route, token, body_hash = nil)
  request(:get, token, bound_route, body_hash)
end

#post(bound_route, token, body_hash = nil) ⇒ Object



44
45
46
# File 'lib/service-client.rb', line 44

def post(bound_route, token, body_hash = nil)
  request(:post, token, bound_route, body_hash)
end

#put(bound_route, token, body_hash = nil) ⇒ Object



40
41
42
# File 'lib/service-client.rb', line 40

def put(bound_route, token, body_hash = nil)
  request(:put, token, bound_route, body_hash)
end

#rawObject



27
28
29
# File 'lib/service-client.rb', line 27

def raw
  @raw_interface ||= RawInterface.new(self)
end

#routesObject Also known as: urls



31
32
33
# File 'lib/service-client.rb', line 31

def routes
  @routes ||= RouteCollection.new
end