Class: OSC::AddressPattern
- Inherits:
-
Object
- Object
- OSC::AddressPattern
- Defined in:
- lib/osc-ruby/address_pattern.rb
Instance Method Summary collapse
-
#initialize(pattern) ⇒ AddressPattern
constructor
A new instance of AddressPattern.
- #match?(address) ⇒ Boolean
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
9 10 11 |
# File 'lib/osc-ruby/address_pattern.rb', line 9 def match?(address) !!(@re.nil? || @re.match(address)) end |