Class: RIO::Match::Entry::And

Inherits:
Base show all
Defined in:
lib/rio/entrysel.rb

Instance Attribute Summary

Attributes inherited from Base

#match_to

Instance Method Summary collapse

Methods inherited from Base

#===, #inspect

Constructor Details

#initialize(matches) ⇒ And

Returns a new instance of And.



85
86
87
# File 'lib/rio/entrysel.rb', line 85

def initialize(matches)
  super(matches.flatten.map { |arg| Match::Entry.create(arg) })
end

Instance Method Details

#=~(el) ⇒ Object



88
89
90
# File 'lib/rio/entrysel.rb', line 88

def =~(el)
  (@match_to.empty? or @match_to.all? { |sel| sel =~ el })
end