Class: BibliographicalImporter::CSV::Reader
- Inherits:
 - 
      Object
      
        
- Object
 - BibliographicalImporter::CSV::Reader
 
 
- Includes:
 - AbstractReader, Enumerable
 
- Defined in:
 - lib/bibliographical_importer/csv.rb
 
Instance Attribute Summary collapse
- 
  
    
      #base  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    
Returns the value of attribute base.
 - 
  
    
      #csv  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    
Returns the value of attribute csv.
 - 
  
    
      #records  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    
Returns the value of attribute records.
 
Class Method Summary collapse
Instance Method Summary collapse
- #[](x) ⇒ Object
 - #each(&block) ⇒ Object
 - 
  
    
      #initialize(csv_o, base)  ⇒ Reader 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    
A new instance of Reader.
 - #parse_records ⇒ Object
 
Constructor Details
#initialize(csv_o, base) ⇒ Reader
Returns a new instance of Reader
      114 115 116 117 118  | 
    
      # File 'lib/bibliographical_importer/csv.rb', line 114 def initialize(csv_o, base) @csv=csv_o @base=base parse_records end  | 
  
Instance Attribute Details
#base ⇒ Object (readonly)
Returns the value of attribute base
      103 104 105  | 
    
      # File 'lib/bibliographical_importer/csv.rb', line 103 def base @base end  | 
  
#csv ⇒ Object (readonly)
Returns the value of attribute csv
      101 102 103  | 
    
      # File 'lib/bibliographical_importer/csv.rb', line 101 def csv @csv end  | 
  
#records ⇒ Object (readonly)
Returns the value of attribute records
      102 103 104  | 
    
      # File 'lib/bibliographical_importer/csv.rb', line 102 def records @records end  | 
  
Class Method Details
.open(filename) ⇒ Object
      120 121 122  | 
    
      # File 'lib/bibliographical_importer/csv.rb', line 120 def self.open(filename) raise "Not implemented" end  | 
  
Instance Method Details
#[](x) ⇒ Object
      106 107 108  | 
    
      # File 'lib/bibliographical_importer/csv.rb', line 106 def [](x) @records[x] end  | 
  
#each(&block) ⇒ Object
      110 111 112  | 
    
      # File 'lib/bibliographical_importer/csv.rb', line 110 def each(&block) @records.each(&block) end  | 
  
#parse_records ⇒ Object
      130 131 132 133 134 135 136 137  | 
    
      # File 'lib/bibliographical_importer/csv.rb', line 130 def parse_records #$log.info(base) if base=="refworks" @records=@csv.map {|r| BibliographicalImporter::CSV::Record_Refworks.create(r)} else raise "TODO" end end  |