class References::Magazine
Public Class Methods
new(&block)
click to toggle source
# 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
Public Instance Methods
formatAPA()
click to toggle source
Format book reference to APA standard @return [String] format output
# 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
issbn(issbn)
click to toggle source
# File lib/references/magazine.rb, line 11 def issbn(issbn) if @issbn.nil? @issbn = [] end @issbn << issbn end