Class: Jeeves::ResolveConstant

Inherits:
Object
  • Object
show all
Defined in:
lib/jeeves/resolve_constant.rb

Class Method Summary collapse

Class Method Details

.call(scope, name) ⇒ Object



3
4
5
6
7
8
9
# File 'lib/jeeves/resolve_constant.rb', line 3

def self.call(scope, name)
  const_name = name.upcase
  if scope.const_defined?(const_name)
    const_value = scope.const_get(const_name)
    lambda { const_value }
  end
end