Class: Aleph::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/angstrom.rb

Direct Known Subclasses

Angstrom

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.connObject

Returns the value of attribute conn.



15
16
17
# File 'lib/angstrom.rb', line 15

def conn
  @conn
end

.routesObject

Returns the value of attribute routes.



15
16
17
# File 'lib/angstrom.rb', line 15

def routes
  @routes
end

Class Method Details

.delete(path, &block) ⇒ Object



21
# File 'lib/angstrom.rb', line 21

def delete(path, &block) route "DELETE", path, &block end

.get(path, &block) ⇒ Object



17
# File 'lib/angstrom.rb', line 17

def get(path, &block) route "GET", path, &block end

.head(path, &block) ⇒ Object



20
# File 'lib/angstrom.rb', line 20

def head(path, &block) route "HEAD", path, &block end

.patch(path, &block) ⇒ Object



22
# File 'lib/angstrom.rb', line 22

def patch(path, &block) route "PATCH", path, &block end

.post(path, &block) ⇒ Object



19
# File 'lib/angstrom.rb', line 19

def post(path, &block) route "POST", path, &block end

.put(path, &block) ⇒ Object



18
# File 'lib/angstrom.rb', line 18

def put(path, &block)  route "PUT",  path, &block end

.route(verb, path, &block) ⇒ Object



24
25
26
27
# File 'lib/angstrom.rb', line 24

def route(verb, path, &block)
  @routes ||= {}
  (@routes[verb] ||= []) << AddRoute.new(compile(path), block)
end