Skip to content

Commit

Permalink
fix bug on assigned attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
eeng committed Oct 31, 2013
1 parent 78e2fb3 commit a3ceab8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/machinist/lathe.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ module Machinist
# The Lathe implements all the methods that are available to the blueprint, # The Lathe implements all the methods that are available to the blueprint,
# including method_missing to let the blueprint define attributes. # including method_missing to let the blueprint define attributes.
class Lathe class Lathe
attr_reader :assigned_attributes

def initialize(klass, serial_number, attributes = {}, overrided_attributes = {}) def initialize(klass, serial_number, attributes = {}, overrided_attributes = {})
@klass = klass @klass = klass
@serial_number = serial_number @serial_number = serial_number
@assigned_attributes = {} @assigned_attributes = {}
@attributes = attributes


@object = @klass.new @object = @klass.new
@overrides = Overrides.new(self, attributes) @overrides = Overrides.new(self, attributes)
Expand Down Expand Up @@ -41,6 +40,10 @@ def overrides &block
@overrides.instance_eval(&block) @overrides.instance_eval(&block)
end end


def assigned_attributes
@attributes
end

protected protected
def make_attribute(attribute, args, &block) #:nodoc: def make_attribute(attribute, args, &block) #:nodoc:
count = args.shift if args.first.is_a?(Fixnum) count = args.shift if args.first.is_a?(Fixnum)
Expand Down

0 comments on commit a3ceab8

Please sign in to comment.