Skip to content

Commit

Permalink
Merge pull request #24 from samnang/use_module_exec
Browse files Browse the repository at this point in the history
Use `module_exec` instead of `module_eval` whenever having variables
  • Loading branch information
Avdi Grimm committed Jun 1, 2013
2 parents e740fc4 + 0d6abfe commit 051d084
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/naught/null_class_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,7 @@ def self.get(*)

def define_basic_methods
defer do |subject|
# make local variable to be accessible to Class.new block
inspect_proc = @inspect_proc
subject.module_eval do
subject.module_exec(@inspect_proc) do |inspect_proc|
define_method(:inspect, &inspect_proc)
def initialize(*)
end
Expand Down

0 comments on commit 051d084

Please sign in to comment.