Class: Agents::HttpObservatoryMozillaAgent
- Inherits:
-
Agent
- Object
- Agent
- Agents::HttpObservatoryMozillaAgent
- Includes:
- FormConfigurable
- Defined in:
- lib/huginn_http_observatory_mozilla_agent/http_observatory_mozilla_agent.rb
Instance Method Summary collapse
Instance Method Details
#check ⇒ Object
72 73 74 |
# File 'lib/huginn_http_observatory_mozilla_agent/http_observatory_mozilla_agent.rb', line 72 def check check_status end |
#default_options ⇒ Object
39 40 41 42 43 44 45 46 47 |
# File 'lib/huginn_http_observatory_mozilla_agent/http_observatory_mozilla_agent.rb', line 39 def { 'debug' => 'false', 'expected_receive_period_in_days' => '2', 'hidden' => 'false', 'rescan' => 'false', 'changes_only' => 'true' } end |
#validate_options ⇒ Object
54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/huginn_http_observatory_mozilla_agent/http_observatory_mozilla_agent.rb', line 54 def if .has_key?('changes_only') && boolify(['changes_only']).nil? errors.add(:base, "if provided, changes_only must be true or false") end if .has_key?('debug') && boolify(['debug']).nil? errors.add(:base, "if provided, debug must be true or false") end unless ['expected_receive_period_in_days'].present? && ['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 end |
#working? ⇒ Boolean
68 69 70 |
# File 'lib/huginn_http_observatory_mozilla_agent/http_observatory_mozilla_agent.rb', line 68 def working? event_created_within?(['expected_receive_period_in_days']) && !recent_error_logs? end |