Class: FakerBot::Bot

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(query) ⇒ Bot

Returns a new instance of Bot.



25
26
27
28
# File 'lib/fakerbot/bot.rb', line 25

def initialize(query)
  @matching_descendants = Hash.new { |h, k| h[k] = [] }
  @query = query
end

Instance Attribute Details

#matching_descendantsObject (readonly)

Returns the value of attribute matching_descendants.



23
24
25
# File 'lib/fakerbot/bot.rb', line 23

def matching_descendants
  @matching_descendants
end

#queryObject (readonly)

Returns the value of attribute query.



23
24
25
# File 'lib/fakerbot/bot.rb', line 23

def query
  @query
end

Class Method Details

.find(query) ⇒ Object



31
32
33
# File 'lib/fakerbot/bot.rb', line 31

def find(query)
  new(query).find
end

Instance Method Details

#findObject



36
37
38
39
# File 'lib/fakerbot/bot.rb', line 36

def find
  search_descendants_matching_query
  matching_descendants
end