Class: ISO
Instance Attribute Summary
Attributes inherited from RuleBase
Class Method Summary collapse
Class Method Details
.fetch(string, base) ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/citation/rules/iso.rb', line 12 def self.fetch(string, base) s = string.gsub(/ ([A-Z]). /,'_\1_ ') string.gsub!('()','') arr = s.split('. ') = arr.shift.gsub(/_([A-Z])_ /,' \1. ') title = arr.shift if title == '' or title.nil? desc = arr.shift type = 'ISO 6900'.to_sym return string, title, , desc, type end |
.satisfy?(string, base) ⇒ Boolean
7 8 9 10 |
# File 'lib/citation/rules/iso.rb', line 7 def self.satisfy?(string, base) @matcher = string.match(/, \.$/) base.type.empty? and not @matcher.nil? end |