Class: Koota::Pattern

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

Overview

This is a simple class holding a pattern string and its references hash.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#refsObject (readonly)

Returns the value of attribute refs.



6
7
8
# File 'lib/koota/pattern.rb', line 6

def refs
  @refs
end

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