Class: APA
Instance Attribute Summary
Attributes inherited from RuleBase
Class Method Summary collapse
Class Method Details
.fetch(string, base) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/citation/rules/apa.rb', line 13 def self.fetch(string, base) title = @matcher[0] unless @matcher.nil? title.gsub!(/"|\(\)\. /,'') string.slice!(title) s = string.split('(). ') = s.shift desc = s.shift type = 'APA'.to_sym string.slice!() unless string.empty? string.slice!(desc) unless string.empty? return string, title, , desc, type end |
.satisfy?(string, base) ⇒ Boolean
8 9 10 11 |
# File 'lib/citation/rules/apa.rb', line 8 def self.satisfy?(string, base) @matcher = string.match(/\(\)\. .+\. /) base.type.empty? and not @matcher.nil? end |