Class: OSC::AddressPattern

Inherits:
Object
  • Object
show all
Defined in:
lib/osc-ruby/address_pattern.rb

Instance Method Summary collapse

Constructor Details

#initialize(pattern) ⇒ AddressPattern

Returns a new instance of AddressPattern.



3
4
5
6
7
# File 'lib/osc-ruby/address_pattern.rb', line 3

def initialize(pattern)
  @pattern = pattern

  generate_regex_from_pattern
end

Instance Method Details

#match?(address) ⇒ Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/osc-ruby/address_pattern.rb', line 9

def match?(address)
  !!(@re.nil? || @re.match(address))
end