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
408 409 410 |
# File 'ext/fortio/lib/fortio/fortran_format.rb', line 408 def count @count end |
#length ⇒ Object
Returns the value of attribute length
408 409 410 |
# File 'ext/fortio/lib/fortio/fortran_format.rb', line 408 def length @length end |
Instance Method Details
#count_args ⇒ Object
429 430 431 |
# File 'ext/fortio/lib/fortio/fortran_format.rb', line 429 def count_args return count end |
#inspect ⇒ Object
432 433 434 435 |
# File 'ext/fortio/lib/fortio/fortran_format.rb', line 432 def inspect count_str = count == 1 ? "" : count.to_s return "#{count_str}L#{length}" end |
#read(io, list, state) ⇒ Object
419 420 421 422 423 424 425 426 427 428 |
# File 'ext/fortio/lib/fortio/fortran_format.rb', line 419 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
410 411 412 413 414 415 416 417 418 |
# File 'ext/fortio/lib/fortio/fortran_format.rb', line 410 def write (io, list, state) count.times do if list.shift io << " "*(length-1) + "T" else io << " "*(length-1) + "F" end end end |