Module: ToyVerbs::Matcher

Defined in:
lib/toy-verbs/matcher.rb

Instance Method Summary collapse

Instance Method Details

#_getObject



9
# File 'lib/toy-verbs/matcher.rb', line 9

alias :_get :get

#draw(*args) ⇒ Object



16
17
18
19
20
# File 'lib/toy-verbs/matcher.rb', line 16

def draw *args
  router = Rails.application.routes
  router.disable_clear_and_finalize = true
  router.draw { send(*args) }
end

#get(*args, &blk) ⇒ Object



11
12
13
14
# File 'lib/toy-verbs/matcher.rb', line 11

def get *args, &blk
  return _get *args, &blk unless args[1].is_a?(Symbol) || args[1].is_a?(String)
  args.each { |action| _get action }
end