Class: Bond::DefaultMission

Inherits:
Mission
  • Object
show all
Defined in:
lib/bond/missions/default_mission.rb

Overview

This is the mission called when none of the others match.

Constant Summary collapse

ReservedWords =
[
  "BEGIN", "END", "alias", "and", "begin", "break", "case", "class", "def", "defined?", "do", "else", "elsif", "end", "ensure",
  "false", "for", "if", "in", "module", "next", "nil", "not", "or", "redo", "rescue", "retry", "return", "self", "super",
  "then", "true", "undef", "unless", "until", "when", "while", "yield"
]

Constants inherited from Mission

Mission::OBJECTS, Mission::OPERATORS

Instance Attribute Summary

Attributes inherited from Mission

#action, #matched, #on, #place

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Mission

#after_match, #call_action, #call_search, #condition, create, current_eval, #do_match, #execute, #match_message, #matches?, #name

Constructor Details

#initialize(options = {}) ⇒ DefaultMission

Returns a new instance of DefaultMission.



16
17
18
19
# File 'lib/bond/missions/default_mission.rb', line 16

def initialize(options={}) #@private
  options[:action] ||= self.class.method(:completions)
  super
end

Class Method Details

.completions(input = nil) ⇒ Object

Default action which generates methods, private methods, reserved words, local variables and constants.



11
12
13
14
# File 'lib/bond/missions/default_mission.rb', line 11

def self.completions(input=nil)
  Bond::Mission.current_eval("methods | private_methods | local_variables | " +
                             "self.class.constants | instance_variables") | ReservedWords
end

Instance Method Details

#default_onObject



20
# File 'lib/bond/missions/default_mission.rb', line 20

def default_on; end