Class: Glaemscribe::API::Charset::SequenceChar

Inherits:
Object
  • Object
show all
Defined in:
lib/api/charset.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#charsetObject

Pointer to parent charset



138
139
140
# File 'lib/api/charset.rb', line 138

def charset
  @charset
end

#lineObject

Line of code



135
136
137
# File 'lib/api/charset.rb', line 135

def line
  @line
end

#namesObject

Names



136
137
138
# File 'lib/api/charset.rb', line 136

def names
  @names
end

#sequenceObject

The sequence of chars



137
138
139
# File 'lib/api/charset.rb', line 137

def sequence
  @sequence
end

Instance Method Details

#finalizeObject



153
154
155
156
157
158
159
160
161
162
163
164
165
# File 'lib/api/charset.rb', line 153

def finalize          
  if @sequence.count == 0
    @charset.errors << Glaeml::Error.new(@line, "Sequence for sequence char is empty.")    
  end
  
  @sequence.each{ |symbol|
    # Check that the sequence is correct
    found = @charset[symbol]
    if !found
      @charset.errors << Glaeml::Error.new(@line, "Sequence char #{symbol} cannot be found in the charset.")
    end
  }    
end

#sequence?Boolean

Returns:

  • (Boolean)


144
145
146
# File 'lib/api/charset.rb', line 144

def sequence?
  true
end

#strObject



148
149
150
151
# File 'lib/api/charset.rb', line 148

def str
  # A sequence char should never arrive unreplaced
  VIRTUAL_CHAR_OUTPUT
end

#virtual?Boolean

Returns:

  • (Boolean)


140
141
142
# File 'lib/api/charset.rb', line 140

def virtual?
  false
end