Class: Format::MLA

Inherits:
Object
  • Object
show all
Includes:
Format
Defined in:
lib/format/mla.rb

Overview

authors(initialed) title i(Journal_iso) year, i(vol(issue)), pages. authors(initialed) (year). “title” u(Journal_medline) vol(issue): pages.

Constant Summary

Constants included from Format

MediaForwarding, Symbol_to_class_string

Instance Method Summary collapse

Methods included from Format

#author_list, #finish, #format, #initialize, #method_missing, new, #par, #punctuate_initials

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Format

Instance Method Details

#articleObject



8
9
10
11
12
13
14
15
16
# File 'lib/format/mla.rb', line 8

def article
  vol_issue = 
    if vol
      "#{b(vol)}#{par(issue)}"
    else
      nil
    end
  [periodize(author_list('.')),  periodize(par(year)), "\"#{periodize(title)}\"", u(journal_medline), "#{vol_issue}: #{pages}"].compact.join(' ') << '.'
end

#article_to_be_submittedObject



18
19
20
21
# File 'lib/format/mla.rb', line 18

def 
  #[periodize(author_list('.')),  periodize(par(year)), "\"#{periodize(title)}\"", i(journal_medline), b(vol), par(issue), ": #{pages}"].compact.join(' ')
  [author_list('.'), "\"#{periodize(title)}\"", u(journal_medline), i('Article to be submitted')].compact.join(' ') << '.'
end

#webpageObject



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/format/mla.rb', line 23

def webpage
  accessed_string = nil
  if year
    accessed_string = '(accessed '
    if month
      accessed_string << month.to_s
      if day
        accessed_string << " #{day}, "
      else
        accessed_string << " "
      end
    end
    accessed_string << year.to_s << ')'
  end

  [periodize(title), url, accessed_string].compact.join(' ') << '.'
end

#workshopObject



41
42
43
44
# File 'lib/format/mla.rb', line 41

def workshop
  [periodize(author_list('.')),  periodize(par(year)), "\"#{periodize(title)}\"", u(name), "#{pages}"].compact.join(' ') << '.'

end