Class: RIO::Match::Entry::List
- Extended by:
- Forwardable
- Defined in:
- lib/rio/entrysel.rb
Instance Attribute Summary collapse
-
#list ⇒ Object
Returns the value of attribute list.
-
#sym ⇒ Object
readonly
Returns the value of attribute sym.
Instance Method Summary collapse
- #<<(el) ⇒ Object
- #===(me_list) ⇒ Object
- #=~(el) ⇒ Object
- #callstr(func, *args) ⇒ Object
-
#initialize(sym, *args) ⇒ List
constructor
A new instance of List.
- #inspect ⇒ Object
Constructor Details
#initialize(sym, *args) ⇒ List
Returns a new instance of List.
127 128 129 130 |
# File 'lib/rio/entrysel.rb', line 127 def initialize(sym,*args) @sym = sym @list = args.map { |arg| Match::Entry.create(arg) } end |
Instance Attribute Details
#list ⇒ Object
Returns the value of attribute list.
126 127 128 |
# File 'lib/rio/entrysel.rb', line 126 def list @list end |
#sym ⇒ Object (readonly)
Returns the value of attribute sym.
125 126 127 |
# File 'lib/rio/entrysel.rb', line 125 def sym @sym end |
Instance Method Details
#<<(el) ⇒ Object
134 135 136 |
# File 'lib/rio/entrysel.rb', line 134 def <<(el) @list << el end |
#===(me_list) ⇒ Object
137 138 139 |
# File 'lib/rio/entrysel.rb', line 137 def ===(me_list) @sym == me_list.sym end |
#=~(el) ⇒ Object
140 141 142 |
# File 'lib/rio/entrysel.rb', line 140 def =~(el) el.__send__(@sym) and (@list.empty? or @list.detect { |sel| sel =~ el }) end |
#callstr(func, *args) ⇒ Object
145 146 147 |
# File 'lib/rio/entrysel.rb', line 145 def callstr(func,*args) self.class.to_s+'['+self.to_s+']'+'.'+func.to_s+'('+args.join(',')+')' end |
#inspect ⇒ Object
131 132 133 |
# File 'lib/rio/entrysel.rb', line 131 def inspect() @sym.to_s+"("+@list.inspect+")" end |