Module: Rodauth::ClassMethods

Defined in:
lib/rodauth.rb

Instance Method Summary collapse

Instance Method Details

#freezeObject



540
541
542
543
544
# File 'lib/rodauth.rb', line 540

def freeze
  opts[:rodauths].each_value(&:freeze)
  opts[:rodauths].freeze
  super
end

#precompile_rodauth_templatesObject



524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
# File 'lib/rodauth.rb', line 524

def precompile_rodauth_templates
  instance = allocate
  rodauth = instance.rodauth

  view_opts = rodauth.send(:loaded_templates).map do |page|
    rodauth.send(:_view_opts, page)
  end
  view_opts << rodauth.send(:button_opts, '', OPTS)

  view_opts.each do |opts|
    instance.send(:retrieve_template, opts).send(:compiled_method, opts[:locals].keys.sort_by(&:to_s))
  end

  nil
end

#rodauth(name = nil) ⇒ Object



520
521
522
# File 'lib/rodauth.rb', line 520

def rodauth(name=nil)
  opts[:rodauths][name]
end