Module: Twke::Routes

Defined in:
lib/twke/routes.rb

Defined Under Namespace

Classes: RoutePrefix

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.connObject

Returns the value of attribute conn.



23
24
25
# File 'lib/twke/routes.rb', line 23

def conn
  @conn
end

Class Method Details

.add(str, *opts, &blk) ⇒ Object



35
36
37
38
39
# File 'lib/twke/routes.rb', line 35

def add(str, *opts, &blk)
  @@conn.behaviour do
    match(str, *opts, &blk)
  end
end

.load(scamp) ⇒ Object



25
26
27
28
29
30
31
32
33
# File 'lib/twke/routes.rb', line 25

def load(scamp)
  @@conn = scamp

  # TODO: Only load the configured plugins
  Plugin.plugins.each do |plgin|
    # TODO: always prefix with 'twke', configurable later?
    plgin.routes(RoutePrefix.new('twke'))
  end
end