Permalink
Browse files

fix bug on assigned attributes

  • Loading branch information...
1 parent 78e2fb3 commit a3ceab8ece25e409ad46323c59c721fe14335b4a @eeng committed Oct 31, 2013
Showing with 5 additions and 2 deletions.
  1. +5 −2 lib/machinist/lathe.rb
@@ -6,12 +6,11 @@ module Machinist
# The Lathe implements all the methods that are available to the blueprint,
# including method_missing to let the blueprint define attributes.
class Lathe
- attr_reader :assigned_attributes
-
def initialize(klass, serial_number, attributes = {}, overrided_attributes = {})
@klass = klass
@serial_number = serial_number
@assigned_attributes = {}
+ @attributes = attributes
@object = @klass.new
@overrides = Overrides.new(self, attributes)
@@ -41,6 +40,10 @@ def overrides &block
@overrides.instance_eval(&block)
end
+ def assigned_attributes
+ @attributes
+ end
+
protected
def make_attribute(attribute, args, &block) #:nodoc:
count = args.shift if args.first.is_a?(Fixnum)

0 comments on commit a3ceab8

Please sign in to comment.