Module: Heimdall::RuneFinder

Included in:
Heimdall
Defined in:
lib/heimdall/rune_finder.rb

Instance Method Summary collapse

Instance Method Details

#rune_class(klass) ⇒ Class

rune_class This method will fetch the rune class for the given controller. note: for this it should be named same the controller. eg: “‘ UsersController –> UsersRune “`

Parameters:

  • klass (string)
    • class of the controller/ rune

Returns:

  • (Class)
    • class of the Rune



14
15
16
17
18
19
20
21
# File 'lib/heimdall/rune_finder.rb', line 14

def rune_class(klass)
  klass ||= "#{fetch_controller}Rune"
  klass = klass.is_a?(String) ? klass.safe_constantize : klass

  raise "Couldn't find rune class" if klass.nil?

  klass
end