lib/at.rb in at-0.1.1 vs lib/at.rb in at-0.1.2
- old
+ new
@@ -12,17 +12,19 @@
end
def method_missing(meth, *args, &blk)
@parent.instance_eval do
if match = meth.to_s.match(/(.*)\=$/)
- instance_variable_set("@#{match[1]}", args)
+ value = args.length == 1 ? args.first : args
+ instance_variable_set("@#{match[1]}", value)
else
if block_given?
instance_variable_set("@#{meth}", args.empty? ? args : blk.call)
else
if args.empty?
instance_variable_get("@#{meth}")
else
+ value = args.length == 1 ? args.first : args
instance_variable_set("@#{meth}", value)
end
end
end
end
\ No newline at end of file