Sha256: 6efa6a7b18bc048bc5a2891c8feec06958c9b02492d43358d1b4d2175f3e72c0

Contents?: true

Size: 800 Bytes

Versions: 23

Compression:

Stored size: 800 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 GlooLang
  module Verbs
    class Wait < GlooLang::Core::Verb

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

      #
      # Run the verb.
      #
      def run
        x = 1
        if @tokens.token_count > 1
          expr = GlooLang::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

23 entries across 23 versions & 1 rubygems

Version Path
gloo-lang-1.4.3 lib/gloo_lang/verbs/wait.rb
gloo-lang-1.4.2 lib/gloo_lang/verbs/wait.rb
gloo-lang-1.4.1 lib/gloo_lang/verbs/wait.rb
gloo-lang-1.4.0 lib/gloo_lang/verbs/wait.rb
gloo-lang-1.3.2 lib/gloo_lang/verbs/wait.rb
gloo-lang-1.3.1 lib/gloo_lang/verbs/wait.rb
gloo-lang-1.3.0 lib/gloo_lang/verbs/wait.rb
gloo-lang-1.2.8 lib/gloo_lang/verbs/wait.rb
gloo-lang-1.2.7 lib/gloo_lang/verbs/wait.rb
gloo-lang-1.2.6 lib/gloo_lang/verbs/wait.rb
gloo-lang-1.2.5 lib/gloo_lang/verbs/wait.rb
gloo-lang-1.2.4 lib/gloo_lang/verbs/wait.rb
gloo-lang-1.2.3 lib/gloo_lang/verbs/wait.rb
gloo-lang-1.2.2 lib/gloo_lang/verbs/wait.rb
gloo-lang-1.2.1 lib/gloo_lang/verbs/wait.rb
gloo-lang-1.2.0 lib/gloo_lang/verbs/wait.rb
gloo-lang-1.1.0 lib/gloo_lang/verbs/wait.rb
gloo-lang-1.0.2 lib/gloo_lang/verbs/wait.rb
gloo-lang-1.0.1 lib/gloo_lang/verbs/wait.rb
gloo-lang-1.0.0 lib/gloo_lang/verbs/wait.rb