Sha256: fa27cb9b527f332a6444e014bebc7b7c2db61389661a724f19c4e25bc1903352

Contents?: true

Size: 788 Bytes

Versions: 25

Compression:

Stored size: 788 Bytes

Contents

# Author::    Eric Crane  (mailto:eric.crane@mac.com)
# Copyright:: Copyright (c) 2020 Eric Crane.  All rights reserved.
#
# Wait for the given number of seconds.
#

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

      KEYWORD = 'wait'.freeze
      KEYWORD_SHORT = 'w'.freeze

      #
      # Run the verb.
      #
      def run
        x = 1
        if @tokens.token_count > 1
          expr = Gloo::Expr::Expression.new( @engine, @tokens.params )
          x = expr.evaluate.to_i
        end
        sleep x
      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

    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
gloo-3.8.0 lib/gloo/verbs/wait.rb
gloo-3.7.0 lib/gloo/verbs/wait.rb
gloo-3.6.2 lib/gloo/verbs/wait.rb
gloo-3.6.1 lib/gloo/verbs/wait.rb
gloo-3.6.0 lib/gloo/verbs/wait.rb
gloo-3.5.0 lib/gloo/verbs/wait.rb
gloo-3.4.1 lib/gloo/verbs/wait.rb
gloo-3.4.0 lib/gloo/verbs/wait.rb
gloo-3.3.0 lib/gloo/verbs/wait.rb
gloo-3.2.0 lib/gloo/verbs/wait.rb
gloo-3.1.1 lib/gloo/verbs/wait.rb
gloo-3.1.0 lib/gloo/verbs/wait.rb
gloo-3.0.1 lib/gloo/verbs/wait.rb
gloo-3.0.0 lib/gloo/verbs/wait.rb
gloo-2.5.0 lib/gloo/verbs/wait.rb
gloo-2.4.3 lib/gloo/verbs/wait.rb
gloo-2.4.2 lib/gloo/verbs/wait.rb
gloo-2.4.1 lib/gloo/verbs/wait.rb
gloo-2.4.0 lib/gloo/verbs/wait.rb
gloo-2.3.1 lib/gloo/verbs/wait.rb