Class: CSKit::Volume
- Inherits:
-
Object
- Object
- CSKit::Volume
- Defined in:
- lib/cskit/volume.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
-
#initialize(config) ⇒ Volume
constructor
A new instance of Volume.
- #parse_citation(citation_text) ⇒ Object
- #parser ⇒ Object
- #reader ⇒ Object
- #readings_for(citation) ⇒ Object
- #resource_path ⇒ Object
Constructor Details
#initialize(config) ⇒ Volume
Returns a new instance of Volume.
8 9 10 |
# File 'lib/cskit/volume.rb', line 8 def initialize(config) @config = config end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
6 7 8 |
# File 'lib/cskit/volume.rb', line 6 def config @config end |
Instance Method Details
#parse_citation(citation_text) ⇒ Object
12 13 14 |
# File 'lib/cskit/volume.rb', line 12 def parse_citation(citation_text) parser.parse(citation_text).to_object end |
#parser ⇒ Object
20 21 22 |
# File 'lib/cskit/volume.rb', line 20 def parser @parser ||= config[:parser].new end |
#reader ⇒ Object
24 25 26 |
# File 'lib/cskit/volume.rb', line 24 def reader @reader ||= config[:reader].new(self) end |
#readings_for(citation) ⇒ Object
16 17 18 |
# File 'lib/cskit/volume.rb', line 16 def readings_for(citation) reader.readings_for(citation) end |
#resource_path ⇒ Object
28 29 30 |
# File 'lib/cskit/volume.rb', line 28 def resource_path config[:resource_path] end |