Class: Chkex::Source::One
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(source) ⇒ One
constructor
A new instance of One.
- #process ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(source) ⇒ One
Returns a new instance of One.
4 5 6 |
# File 'lib/chkex/sources/one.rb', line 4 def initialize(source) super(source) end |
Instance Method Details
#process ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/chkex/sources/one.rb', line 8 def process result = DomainInfo.new(@source) unless result.error.nil? @results[:errors][result.error] = [] unless @results[:errors].key?(result.error) @results[:errors][result.error].push(domain: result.url) end return if result.expires_on.nil? expiry_date = Date.parse(result.expires_on.strftime('%Y-%m-%d')) diff = expiry_date.mjd - @now.mjd @results[:success][diff] = [] unless @results[:success].key?(diff) @results[:success][diff].push(expiry: expiry_date, domain: result.url) end |