7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
# File 'lib/stupidedi/editor/005010/N4.rb', line 7
def critique_n4(n4, acc)
edit(:N4) do
usa_canada =
n4.element(2).select(&:present?).defined? ||
n4.element(4).select(&:blank?).defined? ||
n4.element(4).select{|e| e.node == "US" }.defined? ||
n4.element(7).select(&:blank?).defined?
n4.element(2).tap do |e|
if usa_canada
if e.node.blank? and e.node.situational?
end
else
if e.node.present? and e.node.situational?
end
end
end
n4.element(3).tap do |e|
if usa_canada and e.node =~ /^(\d{1,8}|\d{10,})$/
acc.warn(e, "must be 9-digits for usa")
end
end
n4.element(4).tap do |e|
if usa_canada
if e.node.present? and e.node.situational?
end
else
end
end
end
end
|