Class: Chkex::Source::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/chkex/sources/base.rb

Direct Known Subclasses

List, One

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source_list) ⇒ Base

Returns a new instance of Base.



6
7
8
9
10
11
12
# File 'lib/chkex/sources/base.rb', line 6

def initialize(source_list)
  @now = Date.today
  @source = source_list
  @results = { success: {}, errors: {} }

  process
end

Instance Attribute Details

#resultsObject

Returns the value of attribute results.



4
5
6
# File 'lib/chkex/sources/base.rb', line 4

def results
  @results
end

Instance Method Details

#strip(url) ⇒ Object



14
15
16
17
18
19
# File 'lib/chkex/sources/base.rb', line 14

def strip(url)
  url.gsub('http://', '')
    .gsub('https://', '')
    .gsub('www.', '')
    .gsub('/', '')
end