Class: References::Book
Overview
Represent a book reference
Instance Attribute Summary
Attributes inherited from Reference
Instance Method Summary collapse
-
#formatAPA ⇒ String
Format book reference to APA standard.
-
#isbn(isbn) ⇒ Object
Set some isbn of document, each isbn is store in a list, you can have some in the same book params isbn [String].
-
#subtitle(subtitle) ⇒ Object
Set subtitle of document params subtitle [String].
Methods inherited from Reference
#<=>, #author, #cantidadAuthors, #cantidadIsbn, #cantidadSeries, #date, #editorial, #hasDate, #hasEdition, #hasEditionnumber, #hasTitle, #initialize, #prettyOutput, #title
Constructor Details
This class inherits a constructor from References::Reference
Instance Method Details
#formatAPA ⇒ String
Format book reference to APA standard
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/references/book.rb', line 9 def formatAPA (prettyOutput(@authors.map { |x| x.to_s }) + "(" + @datee.year.to_s + ") " + @title + if @subtitle ": " + @subtitle + "." else "" end + "\n\t"+@serie+". (" + @edition.to_s + ") " + "(" + @editionnumber.to_s + ") " + @isbn.join(", ")) end |
#isbn(isbn) ⇒ Object
Set some isbn of document, each isbn is store in a list, you can have some in the same book params isbn [String]
29 30 31 32 33 34 |
# File 'lib/references/book.rb', line 29 def isbn(isbn) if @isbn.nil? @isbn = [] end @isbn << isbn end |
#subtitle(subtitle) ⇒ Object
Set subtitle of document params subtitle [String]
23 24 25 |
# File 'lib/references/book.rb', line 23 def subtitle(subtitle) @subtitle = subtitle end |