Class: Rack::Campfire

Inherits:
Object
  • Object
show all
Includes:
Coercion, Logging
Defined in:
lib/rack/campfire/coercion.rb,
lib/rack/campfire/campfire.rb,
lib/rack/campfire/logging.rb,
lib/rack/campfire/hooks.rb

Defined Under Namespace

Modules: Coercion, Hooks, Logging

Instance Method Summary collapse

Methods included from Logging

#log_error, #log_message

Methods included from Coercion

#coerce_body, #coerce_rooms

Constructor Details

#initialize(app, subdomain, api_key, rooms = nil) ⇒ Campfire

Returns a new instance of Campfire.



4
5
6
7
8
9
# File 'lib/rack/campfire/campfire.rb', line 4

def initialize(app, subdomain, api_key, rooms = nil)
  @app = app
  @campfire = campfire(subdomain, api_key)
  @rooms = coerce_rooms(rooms)
  listen
end

Instance Method Details

#call(env) ⇒ Object



11
12
13
# File 'lib/rack/campfire/campfire.rb', line 11

def call(env)
  @app.call(env.merge(params))
end