lib/rio/entrysel.rb in rio-0.5.1 vs lib/rio/entrysel.rb in rio-0.6.0

- old
+ new

@@ -1,8 +1,8 @@ #-- # =========================================================================== -# Copyright (c) 2005-2012 Christopher Kleckner +# Copyright (c) 2005-2017 Christopher Kleckner # All rights reserved # # This file is part of the Rio library for ruby. # # Rio is free software; you can redistribute it and/or modify @@ -26,11 +26,11 @@ require 'rio/abstract_method' class ::Object #:nodoc: all def true?() true end def false?() false end end -# 2314 + module RIO module Match #:nodoc: all module Entry class Base attr_reader :match_to @@ -89,12 +89,12 @@ (@match_to.empty? or @match_to.all? { |sel| sel =~ el }) end end def create(arg) case arg - when ::Fixnum then Depth.new(arg) - when ::Range then Depth.new(arg) + when ::Integer then Depth.new(arg) + when ::Range then Depth.new(arg) when ::String then Glob.new(arg) when ::Regexp then Regexp.new(arg) when ::Proc then Proc.new(arg) when ::Symbol then Symbol.new(arg) when ::TrueClass then Any.new(arg) @@ -127,11 +127,11 @@ @sym == me_list.sym end def =~(el) el.__send__(@sym) and (@list.empty? or @list.detect { |sel| sel =~ el }) end - extend Forwardable - def_instance_delegators(:@list,:each) + extend RIO::Fwd + fwd_readers :@list,:each def callstr(func,*args) self.class.to_s+'['+self.to_s+']'+'.'+func.to_s+'('+args.join(',')+')' end end class Sels < Array