Sha256: e171064c79c30396194dd3c95a4acf196a477daf2ef504c3c403d0e4c43099b5

Contents?: true

Size: 1.14 KB

Versions: 10

Compression:

Stored size: 1.14 KB

Contents

# Author::    Eric Crane  (mailto:eric.crane@mac.com)
# Copyright:: Copyright (c) 2019 Eric Crane.  All rights reserved.
#
# Send a message to an object.
# Tell the object to do some known action.
# Also see the Check verb.
#

module Gloo
  module Verbs
    class Tell < Gloo::Core::Verb

      KEYWORD = 'tell'.freeze
      KEYWORD_SHORT = '->'.freeze
      TO = 'to'.freeze
      UNKNOWN_MSG_ERR = 'Missing message!'.freeze

      #
      # Run the verb.
      #
      def run
        msg = @tokens.after_token( TO )

        unless msg
          @engine.err( UNKNOWN_MSG_ERR ) 
          return
        end

        Gloo::Exec::Dispatch.send_message(
          @engine, msg, @tokens.second, @params )
      end

      #
      # Get the Verb's keyword.
      #
      def self.keyword
        return KEYWORD
      end

      #
      # Get the Verb's keyword shortcut.
      #
      def self.keyword_shortcut
        return KEYWORD_SHORT
      end

      # ---------------------------------------------------------------------
      #    Private functions
      # ---------------------------------------------------------------------

      private

    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
gloo-3.10.1 lib/gloo/verbs/tell.rb
gloo-3.10.0 lib/gloo/verbs/tell.rb
gloo-3.9.1 lib/gloo/verbs/tell.rb
gloo-3.9.0 lib/gloo/verbs/tell.rb
gloo-3.8.0 lib/gloo/verbs/tell.rb
gloo-3.7.0 lib/gloo/verbs/tell.rb
gloo-3.6.2 lib/gloo/verbs/tell.rb
gloo-3.6.1 lib/gloo/verbs/tell.rb
gloo-3.6.0 lib/gloo/verbs/tell.rb
gloo-3.5.0 lib/gloo/verbs/tell.rb