Class: Lbp::Transcription
Instance Attribute Summary
Attributes inherited from Resource
Instance Method Summary collapse
- #file(branch: "master", confighash: nil) ⇒ Object
-
#file_part(partid: nil, confighash: nil) ⇒ Object
NOTE: this really is a temporary method, since the database should point to file corresponding to each transcription dynamically generated by the exist-db database.
-
#file_path(branch = "master") ⇒ Object
initionalization handled by Resource Class.
- #transcription_type ⇒ Object
Methods inherited from Resource
create, #description, find, #has_parts, #initialize, #is_part_of, #title, #type, #value, #values
Constructor Details
This class inherits a constructor from Lbp::Resource
Instance Method Details
#file(branch: "master", confighash: nil) ⇒ Object
25 26 27 28 |
# File 'lib/lbp/transcription.rb', line 25 def file(branch: "master", confighash: nil) file = File.new(self.file_path(branch), self.transcription_type, confighash) return file end |
#file_part(partid: nil, confighash: nil) ⇒ Object
NOTE: this really is a temporary method, since the database should point to file corresponding to each transcription dynamically generated by the exist-db database. but this could remain in case it was useful to grab the part from a file that would include a tei header etc.
34 35 36 37 |
# File 'lib/lbp/transcription.rb', line 34 def file_part(partid: nil, confighash: nil) file = FilePart.new(self.file_path, self.transcription_type, confighash, partid) return file end |
#file_path(branch = "master") ⇒ Object
initionalization handled by Resource Class
11 12 13 14 15 16 17 18 |
# File 'lib/lbp/transcription.rb', line 11 def file_path(branch="master") file_path = value("http://scta.info/property/hasXML").to_s #file_path = self.results.dup.filter(:p => RDF::URI("http://scta.info/property/hasXML")).first[:o].to_s if branch != "master" file_path.gsub!("master", branch) end return file_path end |
#transcription_type ⇒ Object
19 20 21 22 23 |
# File 'lib/lbp/transcription.rb', line 19 def transcription_type type = value("http://scta.info/property/transcriptionType") #type = self.results.dup.filter(:p => RDF::URI("http://scta.info/property/transcriptionType")).first[:o].to_s type.to_s.downcase end |