Module: Frenchy

Defined in:
lib/frenchy.rb,
lib/frenchy/model.rb,
lib/frenchy/client.rb,
lib/frenchy/veneer.rb,
lib/frenchy/request.rb,
lib/frenchy/version.rb,
lib/frenchy/resource.rb,
lib/frenchy/collection.rb,
lib/frenchy/instrumentation.rb

Defined Under Namespace

Modules: Instrumentation, Model, Resource, Veneer Classes: Client, Collection, ConfigurationError, Error, InvalidRequest, InvalidResponse, NotFound, Request, ServerError

Constant Summary collapse

VERSION =
"0.0.5"

Class Method Summary collapse

Class Method Details

.find_service(name) ⇒ Object



23
24
25
26
27
28
29
# File 'lib/frenchy.rb', line 23

def self.find_service(name)
  if @services.nil?
    raise(Frenchy::ConfigurationError, "No services have been configured")
  end

  @services[name.to_sym] || raise(Frenchy::ConfigurationError, "No service with name #{name} registered:")
end

.register_service(name, options = {}) ⇒ Object



18
19
20
21
# File 'lib/frenchy.rb', line 18

def self.register_service(name, options={})
  @services ||= {}
  @services[name.to_sym] = Frenchy::Client.new(options)
end