class Bond::OperatorMethodMission

A mission which completes arguments for any module/class method that is an operator i.e. '>' or '*'. Takes same Bond#complete options as MethodMission. The only operator method this mission doesn't complete is '[]='. The operator '[]' should cover the first argument completion of '[]=' anyways.

Constants

CONDITION
OBJECTS
OPERATORS

Protected Instance Methods

after_match(input) click to toggle source
# File lib/bond/missions/operator_method_mission.rb, line 21
def after_match(input)
  set_action_and_search
  @completion_prefix, typed = input.to_s.sub(/#{Regexp.quote(@matched[-1])}$/, ''), @matched[-1]
  create_input typed, :object => @evaled_object, :argument => 1
end
current_methods() click to toggle source
# File lib/bond/missions/operator_method_mission.rb, line 13
def current_methods
  (OPERATORS & MethodMission.action_methods) + ['[']
end
matched_method() click to toggle source
# File lib/bond/missions/operator_method_mission.rb, line 17
def matched_method
  {'['=>'[]'}[@matched[2]] || @matched[2]
end