Sha256: 2bdc6f1c376c286b2e0555abc77aae59e0fde5d6af138c039400c9f2d9faa4cd

Contents?: true

Size: 648 Bytes

Versions: 5

Compression:

Stored size: 648 Bytes

Contents

class Uppercut
  class Conversation < Message
    attr_reader :to

    def initialize(to,base) #:nodoc:
      @to = to
      super base
    end
    
    # Wait for another message from this contact.
    #
    # Expects a block which should receive one parameter, which will be a
    # String.
    #
    # One common use of _wait_for_ is for confirmation of a sensitive action.
    #
    #     command('foo') do |c|
    #       c.send 'Are you sure?'
    #       c.wait_for do |reply|
    #         do_it if reply.downcase == 'yes'
    #       end
    #     end
    def wait_for(&block)
      @base.redirect_from(@to.bare,&block)
    end

  end
end

Version data entries

5 entries across 5 versions & 3 rubygems

Version Path
tyler-uppercut-0.6.2 lib/uppercut/conversation.rb
tyler-uppercut-0.7.0 lib/uppercut/conversation.rb
tyler-uppercut-0.7.1 lib/uppercut/conversation.rb
vasil-uppercut-0.7.1 lib/uppercut/conversation.rb
uppercut-0.7.1 lib/uppercut/conversation.rb