Class: Lbp::Transcription

Inherits:
Resource show all
Defined in:
lib/lbp/transcription.rb

Instance Attribute Summary

Attributes inherited from Resource

#resource_shortId, #resource_url, #results

Instance Method Summary collapse

Methods inherited from Resource

#convert, #initialize, #structureType, #structureType_shortId, #title, #type, #type_shortId

Constructor Details

This class inherits a constructor from Lbp::Resource

Instance Method Details

#file(confighash) ⇒ Object



19
20
21
22
# File 'lib/lbp/transcription.rb', line 19

def file(confighash)
	file = File.new(self.file_path, self.transcription_type, confighash)
	return file
end

#file_part(confighash, partid) ⇒ 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.



28
29
30
31
# File 'lib/lbp/transcription.rb', line 28

def file_part(confighash, partid)
	file = FilePart.new(self.file_path, self.transcription_type, confighash, partid)
	return file
end

#file_pathObject

initionalization handled by Resource Class



11
12
13
# File 'lib/lbp/transcription.rb', line 11

def file_path
	file_path = self.results.dup.filter(:p => RDF::URI("http://scta.info/property/hasXML")).first[:o].to_s
end

#transcription_typeObject



14
15
16
17
# File 'lib/lbp/transcription.rb', line 14

def transcription_type
	type = self.results.dup.filter(:p => RDF::URI("http://scta.info/property/transcriptionType")).first[:o].to_s
	type.downcase
end