Module: Sinatra::MustacheHelper

Defined in:
lib/sinatra/helpers/mustache.rb

Constant Summary collapse

METHODS =
{}

Instance Method Summary collapse

Instance Method Details

#mustache_helper(*args) ⇒ Object Also known as: mustache_helpers



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/sinatra/helpers/mustache.rb', line 5

def mustache_helper *args
  args.each do |arg|
    if arg.is_a? Symbol
      add_to_mustache_helper_methods(arg)
    elsif arg.is_a? Module
      add_to_mustache_helper_methods(*arg.instance_methods, arg)
    else
      raise ArgumentError.new("#{arg.class} can not be used with mustache_helper, please provide a symbol or a Module")
    end
  end
end