Sha256: ebd8bfcf0f01fc3a4b7e37e0501e45276db01d28777ffb87400c58ba971185a1

Contents?: true

Size: 1.21 KB

Versions: 17

Compression:

Stored size: 1.21 KB

Contents

module Bond
  # A string representing the last word the user has typed. This string is passed to a mission
  # action to generate possible completions. This string contains a number of attributes from the
  # matching mission, useful in generating completions.
  class Input < String
    # Actual object a user has just typed. Used by MethodMission and ObjectMission.
    attr_accessor :object
    # MatchData object from the matching mission (Mission#matched).
    attr_reader :matched
    # Current argument number and array of argument strings. Used by MethodMission.
    attr_accessor :argument, :arguments
    # The full line the user has typed.
    attr_reader :line
    def initialize(str, options={}) #@private
      super(str || '')
      @matched = options[:matched]
      @line = options[:line]
      @object = options[:object] if options[:object]
      @argument = options[:argument] if options[:argument]
      @arguments = options[:arguments] if options[:arguments]
    end

    def inspect #@private
      "#<Bond::Input #{self.to_s.inspect} @matched=#{@matched.to_a.inspect} @line=#{@line.inspect} "+
      "@argument=#{@argument.inspect} @arguments=#{@arguments.inspect} @object=#{@object.inspect}>"
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
bond-0.5.1 lib/bond/input.rb
bond-0.5.1-java lib/bond/input.rb
bond-0.5.0 lib/bond/input.rb
bond-0.5.0-java lib/bond/input.rb
bond-0.4.3 lib/bond/input.rb
bond-0.4.3-java lib/bond/input.rb
bond-0.4.2 lib/bond/input.rb
bond-0.4.2-java lib/bond/input.rb
bond-0.4.1 lib/bond/input.rb
bond-0.4.0 lib/bond/input.rb
bond-0.3.5 lib/bond/input.rb
bond-0.3.4 lib/bond/input.rb
bond-0.3.3 lib/bond/input.rb
bond-0.3.2 lib/bond/input.rb
bond-0.3.1 lib/bond/input.rb
bond-0.3.0 lib/bond/input.rb
bond-0.2.2 lib/bond/input.rb