Class: Exlibris::Aleph::Table::Reader::Matcher::Base
- Inherits:
-
Object
- Object
- Exlibris::Aleph::Table::Reader::Matcher::Base
- Defined in:
- lib/exlibris/aleph/table/reader/matcher/base.rb
Direct Known Subclasses
Collections, ItemCirculationPolicies, ItemDisplayMasks, PatronCirculationPolicies, PatronStatuses, SubLibraries
Instance Attribute Summary collapse
-
#regexp ⇒ Object
readonly
Returns the value of attribute regexp.
-
#string ⇒ Object
readonly
Returns the value of attribute string.
Instance Method Summary collapse
-
#initialize(regexp, string) ⇒ Base
constructor
A new instance of Base.
- #match_data ⇒ Object
- #matched_data ⇒ Object
- #matches? ⇒ Boolean
Constructor Details
#initialize(regexp, string) ⇒ Base
Returns a new instance of Base.
9 10 11 12 |
# File 'lib/exlibris/aleph/table/reader/matcher/base.rb', line 9 def initialize(regexp, string) @regexp = regexp @string = string end |
Instance Attribute Details
#regexp ⇒ Object (readonly)
Returns the value of attribute regexp.
7 8 9 |
# File 'lib/exlibris/aleph/table/reader/matcher/base.rb', line 7 def regexp @regexp end |
#string ⇒ Object (readonly)
Returns the value of attribute string.
7 8 9 |
# File 'lib/exlibris/aleph/table/reader/matcher/base.rb', line 7 def string @string end |
Instance Method Details
#match_data ⇒ Object
14 15 16 |
# File 'lib/exlibris/aleph/table/reader/matcher/base.rb', line 14 def match_data @match_data ||= regexp.match(string) end |
#matched_data ⇒ Object
18 19 20 |
# File 'lib/exlibris/aleph/table/reader/matcher/base.rb', line 18 def matched_data @matched_data ||= match_data.captures end |
#matches? ⇒ Boolean
22 23 24 |
# File 'lib/exlibris/aleph/table/reader/matcher/base.rb', line 22 def matches? regexp === string end |