Sha256: 7b452a7ce07b80b2dbc936fda684c95832013460f9c661e75f930a26fce35962

Contents?: true

Size: 650 Bytes

Versions: 15

Compression:

Stored size: 650 Bytes

Contents

module Rulp
  module Initializers
    def initialize(name, args)
      @name = name
      @args = args
      @value = nil
      @identifier = "#{self.name}#{self.args.join("_")}"
      raise StandardError.new("Variable with the name #{self} of a different type (#{LV::names_table[self.to_s].class}) already exists") if LV::names_table[self.to_s]
      LV::names_table[self.to_s] = self
    end

    def self.included(base)
      base.extend(ClassMethods)
    end

    module ClassMethods
      def names_table
        @@names ||= {}
      end

      def clear
        @@names = {}
      end
    end

    def to_s
      @identifier
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
rulp-0.0.46 lib/rulp/rulp_initializers.rb
rulp-0.0.45 lib/rulp/rulp_initializers.rb
rulp-0.0.44 lib/rulp/rulp_initializers.rb
rulp-0.0.43 lib/rulp/rulp_initializers.rb
rulp-0.0.42 lib/rulp/rulp_initializers.rb
rulp-0.0.41 lib/rulp/rulp_initializers.rb
rulp-0.0.40 lib/rulp/rulp_initializers.rb
rulp-0.0.39 lib/rulp/rulp_initializers.rb
rulp-0.0.38 lib/rulp/rulp_initializers.rb
rulp-0.0.37 lib/rulp/rulp_initializers.rb
rulp-0.0.36 lib/rulp/rulp_initializers.rb
rulp-0.0.35 lib/rulp/rulp_initializers.rb
rulp-0.0.34 lib/rulp/rulp_initializers.rb
rulp-0.0.33 lib/rulp/rulp_initializers.rb
rulp-0.0.32 lib/rulp/rulp_initializers.rb