Class: Mutiny::Pattern

Inherits:
Object
  • Object
show all
Defined in:
lib/mutiny/pattern.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#rawObject (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

Returns:

  • (Boolean)


9
10
11
# File 'lib/mutiny/pattern.rb', line 9

def match?(identifier)
  raw == "*" || identifier.start_with?(raw)
end

#to_sObject



13
14
15
# File 'lib/mutiny/pattern.rb', line 13

def to_s
  raw
end