Class: Citrus::GlobalStrings

Inherits:
Object
  • Object
show all
Defined in:
lib/citrus/compiler/global_strings.rb

Class Method Summary collapse

Class Method Details

.init(builder) ⇒ Object



4
5
6
7
# File 'lib/citrus/compiler/global_strings.rb', line 4

def self.init(builder)
  @builder ||= builder
  @pointers ||= {}
end

.pointer(value) ⇒ Object



9
10
11
12
13
14
15
16
# File 'lib/citrus/compiler/global_strings.rb', line 9

def self.pointer(value)
  if @pointers.has_key?(value)
    return @pointers[value]
  else
    @pointers[value] = @builder.global_string_pointer(value)
    return @pointers[value]
  end
end