Class: Ego::Capability

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

Overview

Note:

New capabilities should be specified by plug-ins using the Robot#can method.

A capability defines functionality added to a Robot instance by a plug-in.

Examples:

Add a capability to the robot instance

Ego.plugin do |robot|
  robot.can 'repeat what you say'
  # ...
end

See Also:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(desc) ⇒ Capability

Returns a new instance of Capability.

Parameters:

  • desc (String)

    the capability description answering "What can the robot do?"



23
24
25
26
# File 'lib/ego/capability.rb', line 23

def initialize(desc)
  @desc = desc
  @plugin = Plugin.context
end

Instance Attribute Details

#descObject (readonly)

Returns the value of attribute desc.



20
21
22
# File 'lib/ego/capability.rb', line 20

def desc
  @desc
end

#pluginObject (readonly)

Returns the value of attribute plugin.



20
21
22
# File 'lib/ego/capability.rb', line 20

def plugin
  @plugin
end

Instance Method Details

#to_sString

Returns the capability description.

Returns:

  • (String)

    the capability description



29
30
31
# File 'lib/ego/capability.rb', line 29

def to_s
  @desc
end