Class: Mutiny::Pattern
- Inherits:
-
Object
- Object
- Mutiny::Pattern
- Defined in:
- lib/mutiny/pattern.rb
Instance Attribute Summary collapse
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
Instance Method Summary collapse
-
#initialize(raw) ⇒ Pattern
constructor
A new instance of Pattern.
- #match?(identifier) ⇒ Boolean
- #to_s ⇒ Object
Constructor Details
#initialize(raw) ⇒ Pattern
Returns a new instance of Pattern.
5 6 7 |
# File 'lib/mutiny/pattern.rb', line 5 def initialize(raw) @raw = raw end |
Instance Attribute Details
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
3 4 5 |
# File 'lib/mutiny/pattern.rb', line 3 def raw @raw end |
Instance Method Details
#match?(identifier) ⇒ Boolean
9 10 11 |
# File 'lib/mutiny/pattern.rb', line 9 def match?(identifier) raw == "*" || identifier.start_with?(raw) end |
#to_s ⇒ Object
13 14 15 |
# File 'lib/mutiny/pattern.rb', line 13 def to_s raw end |