Sha256: b4c9d9e499d4c5db1248f4e6c1e824fd146d3ead3ab8115892b486ca25097c2b
Contents?: true
Size: 605 Bytes
Versions: 4
Compression:
Stored size: 605 Bytes
Contents
module FreebaseImporters class Book < Base map :name map :characters, [] add_to_mql :"type", "/book/book" add_to_mql :"/book/written_work/author", [] add_method :authors, CommonAccessors.single(:"/book/written_work/author") add_to_mql :genre, [] add_method :genres, -> { data['genre'] } add_method :genre, -> { genres.first } add_to_mql :"/book/written_work/date_of_first_publication" add_method :date_of_first_publication, -> { pub = data["/book/written_work/date_of_first_publication"] pub ? Date.parse(pub) : nil rescue pub } end end
Version data entries
4 entries across 4 versions & 1 rubygems