Sha256: 5e8f5ffd678b8d7f36cee71fc1f25c53c31a49834dfce340f7307a89fd99c0ae

Contents?: true

Size: 846 Bytes

Versions: 2

Compression:

Stored size: 846 Bytes

Contents

# This is the mission called when none of the others match.
class Bond::DefaultMission < Bond::Mission
  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"
  ]

  #:stopdoc:
  def initialize(options={})
    options[:action] ||= method(:default)
    super
  end
  def default_on; end
  #:startdoc:

  # Default action which generates methods, private methods, reserved words, local variables and constants.
  def default(input)
    Bond::Mission.current_eval("methods | private_methods | local_variables | self.class.constants") | ReservedWords
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
bond-0.2.1 lib/bond/missions/default_mission.rb
bond-0.2.0 lib/bond/missions/default_mission.rb