Module: Rodauth::ClassMethods

Defined in:
lib/rodauth.rb

Instance Method Summary collapse

Instance Method Details

#freezeObject



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

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

#precompile_rodauth_templatesObject



503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
# File 'lib/rodauth.rb', line 503

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, '', {})

  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



499
500
501
# File 'lib/rodauth.rb', line 499

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