Class: CSKit::Volume

Inherits:
Object
  • Object
show all
Defined in:
lib/cskit/volume.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#configObject (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

#parserObject



20
21
22
# File 'lib/cskit/volume.rb', line 20

def parser
  @parser ||= config[:parser].new
end

#readerObject



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_pathObject



28
29
30
# File 'lib/cskit/volume.rb', line 28

def resource_path
  config[:resource_path]
end