Sha256: f7e5b538b91d6992d3d35efab74d53dd511cc082981a43aef47833ff80db9c29

Contents?: true

Size: 672 Bytes

Versions: 1

Compression:

Stored size: 672 Bytes

Contents

# coding: utf-8
require "references"

module References
  class Magazine < Reference
    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

    def issbn(issbn)
      if @issbn.nil?
        @issbn = []
      end
      @issbn << issbn
    end

    # Format book reference to APA standard
    # @return [String] format output
    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
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
referencess-0.1.0 lib/references/magazine.rb