Class: FortranFormatParser::NodeS

Inherits:
Struct
  • Object
show all
Defined in:
ext/fortio/lib/fortio/fortran_format.rb,
ext/fortio/lib/fortio/fortran_format.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#textObject

Returns the value of attribute text

Returns:

  • (Object)

    the current value of text



208
209
210
# File 'ext/fortio/lib/fortio/fortran_format.rb', line 208

def text
  @text
end

Instance Method Details

#count_argsObject



216
217
218
# File 'ext/fortio/lib/fortio/fortran_format.rb', line 216

def count_args
  return 0
end

#inspectObject



219
220
221
222
223
224
225
# File 'ext/fortio/lib/fortio/fortran_format.rb', line 219

def inspect
  if text !~ /'/
    return "'" + text + "'"
  else 
    return '"' + text.gsub(/"/, '""') + '"'
  end
end

#read(io, list, state) ⇒ Object

Raises:

  • (RuntimeError)


213
214
215
# File 'ext/fortio/lib/fortio/fortran_format.rb', line 213

def read (io, list, state)
  raise RuntimeError, "constant string for reading"
end

#write(io, list, state) ⇒ Object



210
211
212
# File 'ext/fortio/lib/fortio/fortran_format.rb', line 210

def write (io, list, state)
  io << text
end