Class: FortranFormatParser::NodeL
- Inherits:
-
Struct
- Object
- Struct
- FortranFormatParser::NodeL
- Defined in:
- ext/fortio/lib/fortio/fortran_format.rb,
ext/fortio/lib/fortio/fortran_format.rb
Instance Attribute Summary collapse
-
#count ⇒ Object
Returns the value of attribute count.
-
#length ⇒ Object
Returns the value of attribute length.
Instance Method Summary collapse
- #count_args ⇒ Object
- #inspect ⇒ Object
- #read(io, list, state) ⇒ Object
- #write(io, list, state) ⇒ Object
Instance Attribute Details
#count ⇒ Object
Returns the value of attribute count
406 407 408 |
# File 'ext/fortio/lib/fortio/fortran_format.rb', line 406 def count @count end |
#length ⇒ Object
Returns the value of attribute length
406 407 408 |
# File 'ext/fortio/lib/fortio/fortran_format.rb', line 406 def length @length end |
Instance Method Details
#count_args ⇒ Object
427 428 429 |
# File 'ext/fortio/lib/fortio/fortran_format.rb', line 427 def count_args return count end |
#inspect ⇒ Object
430 431 432 433 |
# File 'ext/fortio/lib/fortio/fortran_format.rb', line 430 def inspect count_str = count == 1 ? "" : count.to_s return "#{count_str}L#{length}" end |
#read(io, list, state) ⇒ Object
417 418 419 420 421 422 423 424 425 426 |
# File 'ext/fortio/lib/fortio/fortran_format.rb', line 417 def read (io, list, state) count.times do case io.read(length) when /\A *?\.?t/i list.push(true) else list.push(false) end end end |
#write(io, list, state) ⇒ Object
408 409 410 411 412 413 414 415 416 |
# File 'ext/fortio/lib/fortio/fortran_format.rb', line 408 def write (io, list, state) count.times do if list.shift io << " "*(length-1) + "T" else io << " "*(length-1) + "F" end end end |