Sha256: 5881ad485d11da6ce150faa86ca91a86af314983f90233385ebd6a899b2cbd9e

Contents?: true

Size: 898 Bytes

Versions: 23

Compression:

Stored size: 898 Bytes

Contents

# Author::    Eric Crane  (mailto:eric.crane@mac.com)
# Copyright:: Copyright (c) 2019 Eric Crane.  All rights reserved.
#
# Save an object to a file or other persistance mechcanism.
#

module GlooLang
  module Verbs
    class Load < GlooLang::Core::Verb

      KEYWORD = 'load'.freeze
      KEYWORD_SHORT = '<'.freeze
      MISSING_EXPR_ERR = 'Missing Expression!'.freeze

      #
      # Run the verb.
      #
      def run
        fn = @tokens.second

        if fn
          @engine.log.debug "Getting ready to load file: #{fn}"
          @engine.persist_man.load fn
        else
          @engine.err MISSING_EXPR_ERR
        end
      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/load.rb
gloo-lang-1.4.2 lib/gloo_lang/verbs/load.rb
gloo-lang-1.4.1 lib/gloo_lang/verbs/load.rb
gloo-lang-1.4.0 lib/gloo_lang/verbs/load.rb
gloo-lang-1.3.2 lib/gloo_lang/verbs/load.rb
gloo-lang-1.3.1 lib/gloo_lang/verbs/load.rb
gloo-lang-1.3.0 lib/gloo_lang/verbs/load.rb
gloo-lang-1.2.8 lib/gloo_lang/verbs/load.rb
gloo-lang-1.2.7 lib/gloo_lang/verbs/load.rb
gloo-lang-1.2.6 lib/gloo_lang/verbs/load.rb
gloo-lang-1.2.5 lib/gloo_lang/verbs/load.rb
gloo-lang-1.2.4 lib/gloo_lang/verbs/load.rb
gloo-lang-1.2.3 lib/gloo_lang/verbs/load.rb
gloo-lang-1.2.2 lib/gloo_lang/verbs/load.rb
gloo-lang-1.2.1 lib/gloo_lang/verbs/load.rb
gloo-lang-1.2.0 lib/gloo_lang/verbs/load.rb
gloo-lang-1.1.0 lib/gloo_lang/verbs/load.rb
gloo-lang-1.0.2 lib/gloo_lang/verbs/load.rb
gloo-lang-1.0.1 lib/gloo_lang/verbs/load.rb
gloo-lang-1.0.0 lib/gloo_lang/verbs/load.rb