Class: InlineTemplates::BlankObject
- Inherits:
-
BasicObject
- Includes:
- Kernel
- Defined in:
- lib/inline_templates/blank_object.rb
Class Method Summary
collapse
Class Method Details
.drop_methods(methods, keep) ⇒ Object
19
20
21
22
23
24
25
|
# File 'lib/inline_templates/blank_object.rb', line 19
def self.drop_methods(methods, keep)
methods.each do |name|
next if keep.include? name
undef_method name
end
end
|
.make_blank(*keep) ⇒ Object
5
6
7
8
9
10
11
12
13
14
15
16
17
|
# File 'lib/inline_templates/blank_object.rb', line 5
def self.make_blank(*keep)
old_verbose = $VERBOSE
begin
$VERBOSE = nil
drop_methods [ :!, :!=, :==, :__id__, :__send__, :equal?, :instance_eval, :instance_exec ], keep
drop_methods ::Kernel.instance_methods, keep
drop_methods ::Kernel.private_instance_methods, keep
ensure
$VERBOSE = old_verbose
end
end
|