Sha256: fa9aecb8a5b098093d202c5d238764b2599fa29bc2315aad241808cab767dcd8

Contents?: true

Size: 839 Bytes

Versions: 1

Compression:

Stored size: 839 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"
  ]

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

  # 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

1 entries across 1 versions & 1 rubygems

Version Path
bond-0.2.2 lib/bond/missions/default_mission.rb