Module: Trestle::Lazy::Constantize

Included in:
Hash, List
Defined in:
lib/trestle/lazy.rb

Instance Method Summary collapse

Instance Method Details

#constantize(value) ⇒ Object



4
5
6
7
8
9
10
11
12
13
# File 'lib/trestle/lazy.rb', line 4

def constantize(value)
  case value
  when String
    value.safe_constantize
  when Proc
    value.call
  else
    value
  end
end