Class: BibliographicalImporter::JSON::Reader
- Inherits:
-
Object
- Object
- BibliographicalImporter::JSON::Reader
- Includes:
- AbstractReader, Enumerable
- Defined in:
- lib/bibliographical_importer/json.rb
Instance Attribute Summary collapse
-
#jb ⇒ Object
readonly
Returns the value of attribute jb.
-
#records ⇒ Object
readonly
Returns the value of attribute records.
Class Method Summary collapse
Instance Method Summary collapse
- #[](x) ⇒ Object
- #each(&block) ⇒ Object
-
#initialize(json_bib) ⇒ Reader
constructor
A new instance of Reader.
- #parse_records ⇒ Object
Constructor Details
#initialize(json_bib) ⇒ Reader
Returns a new instance of Reader
149 150 151 152 |
# File 'lib/bibliographical_importer/json.rb', line 149 def initialize(json_bib) @jb=json_bib parse_records end |
Instance Attribute Details
#jb ⇒ Object (readonly)
Returns the value of attribute jb
140 141 142 |
# File 'lib/bibliographical_importer/json.rb', line 140 def jb @jb end |
#records ⇒ Object (readonly)
Returns the value of attribute records
141 142 143 |
# File 'lib/bibliographical_importer/json.rb', line 141 def records @records end |
Class Method Details
Instance Method Details
#[](x) ⇒ Object
143 144 145 |
# File 'lib/bibliographical_importer/json.rb', line 143 def [](x) @records[x] end |
#each(&block) ⇒ Object
146 147 148 |
# File 'lib/bibliographical_importer/json.rb', line 146 def each(&block) @records.each(&block) end |
#parse_records ⇒ Object
164 165 166 |
# File 'lib/bibliographical_importer/json.rb', line 164 def parse_records @records=@jb.map {|r| BibliographicalImporter::JSON::Record.create(r)} end |