Method: NicInfo::Notices#is_excessive_notice

Defined in:
lib/nicinfo/notices.rb

#is_excessive_notice(notices) ⇒ Object



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/nicinfo/notices.rb', line 32

def is_excessive_notice notices
  return false if !notices
  return false if notices.length == 0
  return true if notices.length > 2
  word_count = 0
  line_count = 0
  notices.each do |notice|
    descriptions = NicInfo::get_descriptions notice, @config
    descriptions.each do |line|
      line_count = line_count + 1
      word_count = word_count + line.length
    end if descriptions and descriptions.instance_of? Array
  end
  return true if line_count > 10
  return true if word_count > 700
  #otherwise
  return false
end