Class: FakerBot::Bot
- Inherits:
-
Object
- Object
- FakerBot::Bot
- Defined in:
- lib/fakerbot/bot.rb
Instance Attribute Summary collapse
-
#matching_descendants ⇒ Object
readonly
Returns the value of attribute matching_descendants.
-
#query ⇒ Object
readonly
Returns the value of attribute query.
Class Method Summary collapse
Instance Method Summary collapse
- #find ⇒ Object
-
#initialize(query) ⇒ Bot
constructor
A new instance of Bot.
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_descendants ⇒ Object (readonly)
Returns the value of attribute matching_descendants.
23 24 25 |
# File 'lib/fakerbot/bot.rb', line 23 def matching_descendants @matching_descendants end |
#query ⇒ Object (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
#find ⇒ Object
36 37 38 39 |
# File 'lib/fakerbot/bot.rb', line 36 def find search_descendants_matching_query matching_descendants end |