Class: Yarr::Command::Ri

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

Overview

Base class for all ri commands

Direct Known Subclasses

RiCall, RiClassName, RiMethodName

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

Runs the command


20
21
22
# File 'lib/yarr/command/ri.rb', line 20

def handle
  response(query)
end

#response(dataset) ⇒ String

Responds with a string for the dataset. When the dataset is empty or has many items 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_single_item_responder


17
# File 'lib/yarr/command/ri.rb', line 17

define_single_item_responder { |result| result.first.url }