Class: Koota::Pattern
- Inherits:
-
Object
- Object
- Koota::Pattern
- Defined in:
- lib/koota/pattern.rb
Overview
This is a simple class holding a pattern string and its references hash.
Instance Attribute Summary collapse
-
#refs ⇒ Object
readonly
Returns the value of attribute refs.
-
#string ⇒ Object
readonly
Returns the value of attribute string.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(pattern, refs = {}) ⇒ Pattern
constructor
A new instance of Pattern.
Constructor Details
#initialize(pattern, refs = {}) ⇒ Pattern
Returns a new instance of Pattern.
8 9 10 11 |
# File 'lib/koota/pattern.rb', line 8 def initialize(pattern, refs = {}) @string = pattern @refs = refs end |
Instance Attribute Details
#refs ⇒ Object (readonly)
Returns the value of attribute refs.
6 7 8 |
# File 'lib/koota/pattern.rb', line 6 def refs @refs end |
#string ⇒ Object (readonly)
Returns the value of attribute string.
6 7 8 |
# File 'lib/koota/pattern.rb', line 6 def string @string end |
Instance Method Details
#==(other) ⇒ Object
13 14 15 |
# File 'lib/koota/pattern.rb', line 13 def ==(other) other.class == self.class && other.string == string && other.refs == refs end |