Class: FakeHtmlParser

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

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ FakeHtmlParser

Returns a new instance of FakeHtmlParser.



181
182
183
# File 'lib/nibbler.rb', line 181

def initialize(name)
  @name = name
end

Instance Method Details

#at(selector) ⇒ Object



185
186
187
# File 'lib/nibbler.rb', line 185

def at(selector)
  "fake #{@name}"
end

#search(selector) ⇒ Object



189
190
191
# File 'lib/nibbler.rb', line 189

def search(selector)
  (1..3).map { |n| self.class.new(@name + n.to_s) }
end