Module: Redmine::WikiFormatting::Macros::Definitions

Included in:
ApplicationHelper
Defined in:
lib/redmine/wiki_formatting/macros.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) exec_macro(name, obj, args)



22
23
24
25
# File 'lib/redmine/wiki_formatting/macros.rb', line 22

def exec_macro(name, obj, args)
  method_name = "macro_#{name}"
  send(method_name, obj, args) if respond_to?(method_name)
end

- (Object) extract_macro_options(args, *keys)



27
28
29
30
31
32
33
34
# File 'lib/redmine/wiki_formatting/macros.rb', line 27

def extract_macro_options(args, *keys)
  options = {}
  while args.last.to_s.strip =~ %r{^(.+)\=(.+)$} && keys.include?($1.downcase.to_sym)
    options[$1.downcase.to_sym] = $2
    args.pop
  end
  return [args, options]
end