Class: CriticalPathCss::CssFetcher

Inherits:
Object
  • Object
show all
Defined in:
lib/critical_path_css/css_fetcher.rb

Constant Summary collapse

PENTHOUSE_PATH =
"#{File.dirname(__FILE__)}/../penthouse/penthouse.js"

Instance Method Summary collapse

Constructor Details

#initializeCssFetcher

Returns a new instance of CssFetcher.



8
9
10
# File 'lib/critical_path_css/css_fetcher.rb', line 8

def initialize
  @config = Configuration.new
end

Instance Method Details

#fetchObject



12
13
14
# File 'lib/critical_path_css/css_fetcher.rb', line 12

def fetch
  @config.routes.map { |route| [route, css_for_route(route)] }.to_h
end

#fetch_route(route) ⇒ Object



16
17
18
# File 'lib/critical_path_css/css_fetcher.rb', line 16

def fetch_route(route)
  css_for_route route
end