Class: Pageflow::Chart::ScrapedSite

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/pageflow/chart/scraped_site.rb

Instance Method Summary collapse

Instance Method Details

#as_jsonObject



47
48
49
# File 'app/models/pageflow/chart/scraped_site.rb', line 47

def as_json(*)
  super.merge(html_file_url: html_file_url)
end

#csv_urlObject



43
44
45
# File 'app/models/pageflow/chart/scraped_site.rb', line 43

def csv_url
  URI.join(url, 'data.csv').to_s
end

#html_file_urlObject



51
52
53
54
55
56
57
58
# File 'app/models/pageflow/chart/scraped_site.rb', line 51

def html_file_url
  return unless html_file.try(:path)
  if Chart.config.scraped_sites_root_url.present?
    File.join(Chart.config.scraped_sites_root_url, html_file.path)
  else
    html_file.url
  end
end