Module: RIO::Ext::CSV::Cx
- Included in:
- RIO::Ext::Cx
- Defined in:
- lib/rio/ext/csv/csv.rb,
lib/rio/ext/csv/csv-legacy.rb
Instance Method Summary collapse
- #columns(*ranges, &block) ⇒ Object
- #columns? ⇒ Boolean
- #csv(*args, &block) ⇒ Object
- #csv? ⇒ Boolean
- #fields(*ranges, &block) ⇒ Object
- #fields? ⇒ Boolean
- #headers(*args, &block) ⇒ Object
- #headers? ⇒ Boolean
- #skipcolumns(*ranges, &block) ⇒ Object
- #skipfields(*ranges, &block) ⇒ Object
Instance Method Details
#columns(*ranges, &block) ⇒ Object
59 60 61 62 63 64 65 66 67 68 |
# File 'lib/rio/ext/csv/csv.rb', line 59 def columns(*ranges,&block) if skipping? cx['skipping'] = false skipcolumns(*args,&block) else @cnames = nil cx['col_args'] = ranges.flatten cxx('columns',true,&block) end end |
#columns? ⇒ Boolean
74 75 76 |
# File 'lib/rio/ext/csv/csv.rb', line 74 def columns?() cxx?('columns') end |
#csv(*args, &block) ⇒ Object
33 34 35 36 |
# File 'lib/rio/ext/csv/csv.rb', line 33 def csv(*args,&block) cx['csv_args'] = args cxx('csv',true,&block) end |
#csv? ⇒ Boolean
37 |
# File 'lib/rio/ext/csv/csv.rb', line 37 def csv?() cxx?('csv') end |
#fields(*ranges, &block) ⇒ Object
77 78 79 80 81 82 83 84 85 86 |
# File 'lib/rio/ext/csv/csv.rb', line 77 def fields(*ranges,&block) if skipping? cx['skipping'] = false skipfields(*args,&block) else @cnames = nil cx['fields_args'] = ranges.flatten cxx('fields',true,&block) end end |
#fields? ⇒ Boolean
92 93 94 |
# File 'lib/rio/ext/csv/csv.rb', line 92 def fields?() cxx?('fields') end |
#headers(*args, &block) ⇒ Object
43 44 45 46 47 48 49 50 51 |
# File 'lib/rio/ext/csv/csv.rb', line 43 def headers(*args,&block) if args.empty? cx['headers_args'] = true else cx['headers_args'] = args[0] cx['headers'] = cx['headers_args'] end cxx('csv',true,&block) end |
#headers? ⇒ Boolean
52 53 54 55 56 57 |
# File 'lib/rio/ext/csv/csv.rb', line 52 def headers?() unless cx['headers'] cx['headers'] = self.records[0] end cxx?('headers') end |
#skipcolumns(*ranges, &block) ⇒ Object
69 70 71 72 73 |
# File 'lib/rio/ext/csv/csv.rb', line 69 def skipcolumns(*ranges,&block) @cnames = nil cx['nocol_args'] = ranges.flatten cxx('columns',true,&block) end |
#skipfields(*ranges, &block) ⇒ Object
87 88 89 90 91 |
# File 'lib/rio/ext/csv/csv.rb', line 87 def skipfields(*ranges,&block) @cnames = nil cx['nofields_args'] = ranges.flatten cxx('fields',true,&block) end |