lib/rio/grande.rb in rio-0.3.1 vs lib/rio/grande.rb in rio-0.3.2
- old
+ new
@@ -46,9 +46,34 @@
return self.__send__(ss_type,*(ss_args)).to_a
else
return to_a()
end
end
+
+ def fixnumss(*args)
+ #p "#{callstr('[]',*args)} ss_type=#{cx['ss_type']} stream_iter=#{stream_iter?}"
+ #p args[0].class,ss_type?(_ss_keys())
+ ss_args = cx['ss_args'] = args
+ if ss_args.length == 1 and ss_args[0].kind_of?(Fixnum) and !cx.has_key?('dirlines')
+ ans = nil
+ ss_type = ss_type?(_ss_keys())
+
+ if ss_args and ss_type
+ ans = self.__send__(ss_type,*(ss_args)).to_a
+ else
+ ans = to_a()
+ end
+
+ return (ans.empty? ? nil : ans[0])
+ else
+ if ss_args and (ss_type = ss_type?(_ss_keys()))
+ return self.__send__(ss_type,*(ss_args)).to_a
+ else
+ return to_a()
+ end
+ end
+ end
+
end
end
module RIO
module Grande
module Dir