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



179
180
181
# File 'lib/api/charset.rb', line 179

def charset
  @charset
end

#lineObject

Line of code



176
177
178
# File 'lib/api/charset.rb', line 176

def line
  @line
end

#namesObject

Names



177
178
179
# File 'lib/api/charset.rb', line 177

def names
  @names
end

#sequenceObject

The sequence of chars



178
179
180
# File 'lib/api/charset.rb', line 178

def sequence
  @sequence
end

Instance Method Details

#finalizeObject



194
195
196
197
198
199
200
201
202
203
204
205
206
# File 'lib/api/charset.rb', line 194

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)


185
186
187
# File 'lib/api/charset.rb', line 185

def sequence?
  true
end

#strObject



189
190
191
192
# File 'lib/api/charset.rb', line 189

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

#virtual?Boolean

Returns:

  • (Boolean)


181
182
183
# File 'lib/api/charset.rb', line 181

def virtual?
  false
end