lib/raabro.rb in raabro-1.1.4 vs lib/raabro.rb in raabro-1.1.5

- old
+ new

@@ -23,11 +23,11 @@ #++ module Raabro - VERSION = '1.1.4' + VERSION = '1.1.5' class Input attr_accessor :string, :offset attr_reader :options @@ -110,27 +110,27 @@ def nonstring(l=7) @input.string[@offset, l] end - def lookup(name) + def lookup(name=nil) name = name ? name.to_s : nil return self if @name && name == nil return self if @name.to_s == name sublookup(name) end - def sublookup(name) + def sublookup(name=nil) @children.each { |c| if n = c.lookup(name); return n; end } nil end - def gather(name, acc=[]) + def gather(name=nil, acc=[]) name = name ? name.to_s : nil if (@name && name == nil) || (@name.to_s == name) acc << self @@ -139,10 +139,10 @@ end acc end - def subgather(name, acc=[]) + def subgather(name=nil, acc=[]) @children.each { |c| c.gather(name, acc) } acc end