Sha256: 0f4e63c67dde3cabf78213ff3becab26216e6fbe737e2364aa7fe726fd1cfd0e

Contents?: true

Size: 1.04 KB

Versions: 19

Compression:

Stored size: 1.04 KB

Contents

# Author::    Eric Crane  (mailto:eric.crane@mac.com)
# Copyright:: Copyright (c) 2020 Eric Crane.  All rights reserved.
#
# A Time object (does not include a date).
#

module GlooLang
  module Objs
    class Time < GlooLang::Core::Obj

      KEYWORD = 'time'.freeze
      KEYWORD_SHORT = 'time'.freeze

      #
      # The name of the object type.
      #
      def self.typename
        return KEYWORD
      end

      #
      # The short name of the object type.
      #
      def self.short_typename
        return KEYWORD_SHORT
      end

      # ---------------------------------------------------------------------
      #    Messages
      # ---------------------------------------------------------------------

      #
      # Get a list of message names that this object receives.
      #
      def self.messages
        return super + %w[now]
      end

      #
      # Set to the current time.
      #
      def msg_now
        t = DateTime.now.strftime( '%I:%M:%S %P' )
        self.value = t
        @engine.heap.it.set_to t
      end

    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
gloo-lang-1.3.2 lib/gloo_lang/objs/dt/time.rb
gloo-lang-1.3.1 lib/gloo_lang/objs/dt/time.rb
gloo-lang-1.3.0 lib/gloo_lang/objs/dt/time.rb
gloo-lang-1.2.8 lib/gloo_lang/objs/dt/time.rb
gloo-lang-1.2.7 lib/gloo_lang/objs/dt/time.rb
gloo-lang-1.2.6 lib/gloo_lang/objs/dt/time.rb
gloo-lang-1.2.5 lib/gloo_lang/objs/dt/time.rb
gloo-lang-1.2.4 lib/gloo_lang/objs/dt/time.rb
gloo-lang-1.2.3 lib/gloo_lang/objs/dt/time.rb
gloo-lang-1.2.2 lib/gloo_lang/objs/dt/time.rb
gloo-lang-1.2.1 lib/gloo_lang/objs/dt/time.rb
gloo-lang-1.2.0 lib/gloo_lang/objs/dt/time.rb
gloo-lang-1.1.0 lib/gloo_lang/objs/dt/time.rb
gloo-lang-1.0.2 lib/gloo_lang/objs/dt/time.rb
gloo-lang-1.0.1 lib/gloo_lang/objs/dt/time.rb
gloo-lang-1.0.0 lib/gloo_lang/objs/dt/time.rb
gloo-lang-0.9.11 lib/gloo_lang/objs/dt/time.rb
gloo-lang-0.9.10 lib/gloo_lang/objs/dt/time.rb
gloo-lang-0.9.9 lib/gloo_lang/objs/dt/time.rb