Module: Camping::Controllers

Defined in:
lib/camping.rb,
lib/camping-mural.rb

Defined Under Namespace

Modules: RM Classes: NotFound, R

Class Method Summary collapse

Class Method Details

.D(path) ⇒ Object



64
65
66
67
68
69
70
# File 'lib/camping.rb', line 64

def D(path)
  constants.each do |c| 
      k = const_get(c)
      return k, $~[1..-1] if (k.urls rescue "/#{c.downcase}").find { |x| path =~ /^#{x}\/?$/ }
  end
  [NotFound, []]
end

.R(*urls) ⇒ Object



63
# File 'lib/camping.rb', line 63

def R(*urls); Class.new(R) { meta_def(:inherited) { |c| c.meta_def(:urls) { urls } } }; end