Module | Foreman::Helpers |
In: |
lib/foreman/helpers.rb
|
Given a word with dashes, returns a camel cased version of it.
classify(‘job-name’) # => ‘JobName‘
constantize("Module") # => Module constantize("Test::Unit") # => Test::Unit
The name is assumed to be the one of a top-level constant, no matter whether it starts with "::" or not. No lexical context is taken into account:
C = ‘outside’ module M
C = 'inside' C # => 'inside' constantize("C") # => 'outside', same as ::C
end
NameError is raised when the constant is unknown.