Class: Picky::Tokenizer::RegexpWrapper

Inherits:
Object
  • Object
show all
Defined in:
lib/picky/tokenizer/regexp_wrapper.rb

Instance Method Summary collapse

Constructor Details

#initialize(regexp) ⇒ RegexpWrapper

Returns a new instance of RegexpWrapper.



7
8
9
10
# File 'lib/picky/tokenizer/regexp_wrapper.rb', line 7

def initialize regexp
  @regexp = regexp
  @splitter = Splitter.new @regexp
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args, &block) ⇒ Object



20
21
22
# File 'lib/picky/tokenizer/regexp_wrapper.rb', line 20

def method_missing name, *args, &block
  @regexp.send name, *args, &block
end

Instance Method Details

#sourceObject



16
17
18
# File 'lib/picky/tokenizer/regexp_wrapper.rb', line 16

def source
  @regexp.source
end

#split(text) ⇒ Object



12
13
14
# File 'lib/picky/tokenizer/regexp_wrapper.rb', line 12

def split text
  @splitter.multi text
end