Class: Module

Inherits:
Object
  • Object
show all
Defined in:
lib/procon_bypass_man/web/setting_parser.rb

Overview

pluginの定数を握りつぶす

Instance Method Summary collapse

Instance Method Details

#const_missing(id) ⇒ Object

Raises:

  • (NameError)


7
8
9
10
11
# File 'lib/procon_bypass_man/web/setting_parser.rb', line 7

def const_missing(id)
  raise(NameError, "uninitialized constant #{id}") unless self.name =~ /^ProconBypassMan/
  eval "module #{self.name}::#{id}; end", Object::TOPLEVEL_BINDING
  eval "#{self.name}::#{id}"
end