Sha256: f0b9af2d16a14245d46dd5e8b00e2b551d0ad390d47d76423db6b88f85c52b36

Contents?: true

Size: 891 Bytes

Versions: 6

Compression:

Stored size: 891 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
          $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

6 entries across 6 versions & 1 rubygems

Version Path
gloo-lang-0.9.8 lib/gloo_lang/verbs/load.rb
gloo-lang-0.9.7 lib/gloo_lang/verbs/load.rb
gloo-lang-0.9.6 lib/gloo_lang/verbs/load.rb
gloo-lang-0.9.5 lib/gloo_lang/verbs/load.rb
gloo-lang-0.9.4 lib/gloo_lang/verbs/load.rb
gloo-lang-0.9.3 lib/gloo_lang/verbs/load.rb