Class: References::Magazine
- Inherits:
-
Reference
- Object
- Reference
- References::Magazine
- Defined in:
- lib/references/magazine.rb
Instance Attribute Summary
Attributes inherited from Reference
Instance Method Summary (collapse)
-
- (String) formatAPA
Format book reference to APA standard.
-
- (Magazine) initialize(&block)
constructor
A new instance of Magazine.
- - (Object) issbn(issbn)
Methods inherited from Reference
#<=>, #author, #cantidadAuthors, #cantidadIsbn, #cantidadSeries, #date, #editorial, #hasDate, #hasEdition, #hasEditionnumber, #hasTitle, #prettyOutput, #title
Constructor Details
- (Magazine) initialize(&block)
Returns a new instance of Magazine
6 7 8 9 |
# File 'lib/references/magazine.rb', line 6 def initialize(&block) instance_eval &block @title = @title.split(" ").map { |x| if x.length >= 4 then x[0].upcase + x[1..-1] end }.join(" ") end |
Instance Method Details
- (String) formatAPA
Format book reference to APA standard
20 21 22 23 24 25 |
# File 'lib/references/magazine.rb', line 20 def formatAPA (prettyOutput(@authors.map { |x| x.to_s }) + "(" + @datee.year.to_s + ") " + @title + "\n\t(" + @edition.to_s + ") " + "(" + @editionnumber.to_s + ") " + @issbn.join(", ")) end |
- (Object) issbn(issbn)
11 12 13 14 15 16 |
# File 'lib/references/magazine.rb', line 11 def issbn(issbn) if @issbn.nil? @issbn = [] end @issbn << issbn end |