Class: Preflight::Rules::InfoSpecifiesTrapping

Inherits:
Object
  • Object
show all
Defined in:
lib/preflight/rules/info_specifies_trapping.rb

Instance Method Summary collapse

Instance Method Details

#messages(ohash) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/preflight/rules/info_specifies_trapping.rb', line 7

def messages(ohash)
  info = ohash.object(ohash.trailer[:Info])

  if !info.has_key?(:Trapped)
    [ "Info dict does not specify Trapped" ]
  elsif info[:Trapped] != :True && info[:Trapped] != :False
    [ "Trapped value of Info dict must be True or False" ]
  else
    []
  end
end