Skip to content

Commit

Permalink
Merge 9b7fc43 into 9d1971c
Browse files Browse the repository at this point in the history
  • Loading branch information
padi committed Jan 26, 2014
2 parents 9d1971c + 9b7fc43 commit 5417f3d
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions lib/naught/null_class_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,18 @@ def generate_class
respond_to_any_message unless interface_defined?
generation_mod = Module.new
customization_mod = customization_module # get a local binding
builder = self

apply_operations(operations, generation_mod)
null_class = initialize_base_class(generation_mod, customization_mod)
apply_operations(class_operations, null_class)

null_class
end

def initialize_base_class(generation_mod, customization_mod)
builder = self

null_class = Class.new(@base_class) do
Class.new(@base_class) do
const_set :GeneratedMethods, generation_mod
const_set :Customizations, customization_mod
const_set :NULL_EQUIVS, builder.null_equivalents
Expand All @@ -57,10 +64,6 @@ def generate_class
include generation_mod
include customization_mod
end

apply_operations(class_operations, null_class)

null_class
end

def method_missing(method_name, *args, &block)
Expand Down

0 comments on commit 5417f3d

Please sign in to comment.