Class: Rawk::Record
- Inherits:
-
String
- Object
- String
- Rawk::Record
- Defined in:
- lib/rawk/rawk.rb
Class Method Summary collapse
Instance Method Summary collapse
- #cols ⇒ Object (also: #c)
-
#initialize(str, fs, eor = "\n") ⇒ Record
constructor
A new instance of Record.
- #nf ⇒ Object
Constructor Details
#initialize(str, fs, eor = "\n") ⇒ Record
Returns a new instance of Record.
88 89 90 91 |
# File 'lib/rawk/rawk.rb', line 88 def initialize(str, fs, eor = "\n") self.replace(str.chomp(eor)) @fs = fs end |
Class Method Details
.column_postion_accessor(name, position) ⇒ Object
82 83 84 85 86 |
# File 'lib/rawk/rawk.rb', line 82 def self.column_postion_accessor(name, position) define_method(name.to_sym) do cols[position] end end |
Instance Method Details
#cols ⇒ Object Also known as: c
93 94 95 |
# File 'lib/rawk/rawk.rb', line 93 def cols split(@fs) end |
#nf ⇒ Object
98 99 100 |
# File 'lib/rawk/rawk.rb', line 98 def nf cols.length end |