Class: Yarr::Command::List

Inherits:
Base
  • Object
show all
Extended by:
Concern::ASTDigger
Includes:
Concern::Responder
Defined in:
lib/yarr/command/list.rb

Overview

Base class for all list commands

Direct Known Subclasses

ListCall, ListClassName, ListMethodName

Instance Attribute Summary

Attributes inherited from Base

#ast, #irc

Instance Method Summary collapse

Methods included from Concern::ASTDigger

digger

Methods included from Concern::Responder

#advice

Methods inherited from Base

#initialize, match?

Constructor Details

This class inherits a constructor from Yarr::Command::Base

Instance Method Details

#handleObject

Command handler


22
23
24
# File 'lib/yarr/command/list.rb', line 22

def handle
  response(query)
end

#response(dataset) ⇒ String

Responds with a string for the dataset. When the dataset is empty our response would report back that to the user, otherwise the client code defines what the response should be. This method was defined by define_multi_item_responder


17
18
19
# File 'lib/yarr/command/list.rb', line 17

define_multi_item_responder do |result|
  result.map(&:full_name).join(', ')
end