Skip to content

Commit

Permalink
fix registration in array type
Browse files Browse the repository at this point in the history
  • Loading branch information
emonti committed May 1, 2011
1 parent 56acce4 commit 64e2597
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/rstruct/base_types/array_type.rb
Expand Up @@ -11,8 +11,9 @@ class ArrayType < ContainerType
attr_reader :count

def initialize(name, typ, count, opts={}, &block)
lkupreg = (opts[:fields_from] || opts[:register] || Rstruct.default_registry)
super(name, opts, &block)
opts = opts.dup
lkupreg = (opts.delete(:fields_from) || opts.delete(:register) || Rstruct.default_registry)
super(name, opts.merge(:register => false), &block)
@count = count
unless @rtype = lkupreg[typ]
raise(InvalidTypeError, "invalid array type #{typ.inspect}")
Expand Down

0 comments on commit 64e2597

Please sign in to comment.