Class: Amrita2::Core::AttrMatcher
- Defined in:
- lib/amrita2/core.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#sym ⇒ Object
readonly
Returns the value of attribute sym.
Instance Method Summary collapse
-
#initialize(sym, val) ⇒ AttrMatcher
constructor
A new instance of AttrMatcher.
- #match(e) ⇒ Object
Methods inherited from Matcher
Constructor Details
#initialize(sym, val) ⇒ AttrMatcher
Returns a new instance of AttrMatcher.
684 685 686 687 688 |
# File 'lib/amrita2/core.rb', line 684 def initialize(sym, val) @sym = sym @sym_s = sym.to_s @val = val end |
Instance Attribute Details
#sym ⇒ Object (readonly)
Returns the value of attribute sym.
683 684 685 |
# File 'lib/amrita2/core.rb', line 683 def sym @sym end |
Instance Method Details
#match(e) ⇒ Object
690 691 692 693 694 695 696 |
# File 'lib/amrita2/core.rb', line 690 def match(e) if @val != '*' @val == e.attributes[@sym_s] else e.attributes[@sym_s] end end |