Class: RailsAdmin::Config::ConstLoadSuppressor::ConstProxy
- Inherits:
-
BasicObject
- Defined in:
- lib/rails_admin/config/const_load_suppressor.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
47
48
49
|
# File 'lib/rails_admin/config/const_load_suppressor.rb', line 47
def initialize(name)
@name = name
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args, &block) ⇒ Object
68
69
70
|
# File 'lib/rails_admin/config/const_load_suppressor.rb', line 68
def method_missing(method_name, *args, &block)
klass.send(method_name, *args, &block)
end
|
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
45
46
47
|
# File 'lib/rails_admin/config/const_load_suppressor.rb', line 45
def name
@name
end
|
Instance Method Details
#klass ⇒ Object
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
# File 'lib/rails_admin/config/const_load_suppressor.rb', line 51
def klass
@klass ||=
begin
unless ::Object.const_defined?(name)
::Kernel.raise " The constant \#{name} is not loaded yet upon the execution of the RailsAdmin initializer.\n We don't recommend to do this and may lead to issues, but if you really have to do so you can explicitly require it by adding:\n\n require '\#{name.underscore}'\n\n on top of config/initializers/rails_admin.rb.\n MESSAGE\n end\n name.constantize\n end\nend\n"
|
#respond_to_missing?(method_name, include_private = false) ⇒ Boolean
72
73
74
|
# File 'lib/rails_admin/config/const_load_suppressor.rb', line 72
def respond_to_missing?(method_name, include_private = false)
super || klass.respond_to?(method_name, include_private)
end
|