Module: Rulp::Initializers

Included in:
LV
Defined in:
lib/rulp/rulp_initializers.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



10
11
12
# File 'lib/rulp/rulp_initializers.rb', line 10

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

Instance Method Details

#initialize(name, args) ⇒ Object

Raises:

  • (StandardError)


3
4
5
6
7
8
# File 'lib/rulp/rulp_initializers.rb', line 3

def initialize(name, args)
  @name = name
  @args = args
  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

#to_sObject



24
25
26
# File 'lib/rulp/rulp_initializers.rb', line 24

def to_s
  "#{self.name}#{self.args.join("_")}"
end