Class: Webspinne::CSVReport

Inherits:
Struct
  • Object
show all
Defined in:
lib/webspinne/csv_report.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#indexObject

Returns the value of attribute index

Returns:

  • (Object)

    the current value of index



4
5
6
# File 'lib/webspinne/csv_report.rb', line 4

def index
  @index
end

Instance Method Details

#to_file(path) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/webspinne/csv_report.rb', line 5

def to_file path
  CSV.open(path, "wb") do |csv|
    csv << ['uri', 'onsite', 'visited']
    index.each do |link|
      csv << [link.uri, link.onsite?, link.visited?]
    end
  end
end