Class: Bond::ObjectMission

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

Overview

A mission which completes an object’s methods. For this mission to match, the condition must match and the current object must have an ancestor that matches :object. Note: To access to the current object being completed on within an action, use the input’s object attribute.

Bond.complete Options:

:action

If an action is not specified, the default action is to complete an object’s

  non-operator methods.
Example:
  Bond.complete(:object=>'ActiveRecord::Base') {|input| input.object.class.instance_methods(false) }

Constant Summary

OBJECTS =
%w<\S+> + Bond::Mission::OBJECTS
CONDITION =
'(OBJECTS)\.(\w*(?:\?|!)?)$'

Constants inherited from Mission

OBJECTS, OPERATORS

Method Summary

Methods inherited from Mission

#call_action, #call_search, #condition, create, current_eval, #execute, #matches?, #name