Class: Aleph::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/armstrong.rb,
lib/armstrong/main_actors.rb

Direct Known Subclasses

Armstrong

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.connObject

Returns the value of attribute conn.



17
18
19
# File 'lib/armstrong.rb', line 17

def conn
  @conn
end

.container_procObject

Returns the value of attribute container_proc.



5
6
7
# File 'lib/armstrong/main_actors.rb', line 5

def container_proc
  @container_proc
end

.replierObject

Returns the value of attribute replier.



4
5
6
# File 'lib/armstrong/main_actors.rb', line 4

def replier
  @replier
end

.replier_procObject

Returns the value of attribute replier_proc.



5
6
7
# File 'lib/armstrong/main_actors.rb', line 5

def replier_proc
  @replier_proc
end

.request_handlerObject

Returns the value of attribute request_handler.



4
5
6
# File 'lib/armstrong/main_actors.rb', line 4

def request_handler
  @request_handler
end

.request_handler_procObject

Returns the value of attribute request_handler_proc.



5
6
7
# File 'lib/armstrong/main_actors.rb', line 5

def request_handler_proc
  @request_handler_proc
end

.routesObject

Returns the value of attribute routes.



17
18
19
# File 'lib/armstrong.rb', line 17

def routes
  @routes
end

.supervisorObject

Returns the value of attribute supervisor.



4
5
6
# File 'lib/armstrong/main_actors.rb', line 4

def supervisor
  @supervisor
end

.supervisor_procObject

Returns the value of attribute supervisor_proc.



5
6
7
# File 'lib/armstrong/main_actors.rb', line 5

def supervisor_proc
  @supervisor_proc
end

Class Method Details

.delete(path, &block) ⇒ Object



36
# File 'lib/armstrong.rb', line 36

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

.get(path, &block) ⇒ Object



32
# File 'lib/armstrong.rb', line 32

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

.head(path, &block) ⇒ Object



35
# File 'lib/armstrong.rb', line 35

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

.new_uuidObject



19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/armstrong.rb', line 19

def new_uuid
  values = [
    rand(0x0010000),
    rand(0x0010000),
    rand(0x0010000),
    rand(0x0010000),
    rand(0x0010000),  
    rand(0x1000000),
    rand(0x1000000),
  ]
  "%04x%04x-%04x-%04x-%04x%06x%06x" % values
end

.patch(path, &block) ⇒ Object



37
# File 'lib/armstrong.rb', line 37

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

.post(path, &block) ⇒ Object



34
# File 'lib/armstrong.rb', line 34

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

.put(path, &block) ⇒ Object



33
# File 'lib/armstrong.rb', line 33

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

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



39
40
41
42
# File 'lib/armstrong.rb', line 39

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