80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
|
# File 'lib/huginn_http_observatory_mozilla_agent/http_observatory_mozilla_agent.rb', line 80
def validate_options
if options.has_key?('changes_only') && boolify(options['changes_only']).nil?
errors.add(:base, "if provided, changes_only must be true or false")
end
if options.has_key?('debug') && boolify(options['debug']).nil?
errors.add(:base, "if provided, debug must be true or false")
end
unless options['expected_receive_period_in_days'].present? && options['expected_receive_period_in_days'].to_i > 0
errors.add(:base, "Please provide 'expected_receive_period_in_days' to indicate how many days can pass before this Agent is considered to be not working")
end
if options.has_key?('hidden') && boolify(options['hidden']).nil?
errors.add(:base, "if provided, hidden must be true or false")
end
if options.has_key?('rescan') && boolify(options['rescan']).nil?
errors.add(:base, "if provided, rescan must be true or false")
end
end
|