Class: Roll::Amp::Style::CompiledStylesheetFile
- Inherits:
-
Object
- Object
- Roll::Amp::Style::CompiledStylesheetFile
- Defined in:
- lib/roll/amp/style/compiled_stylesheet_file.rb
Overview
The stylesheet file, compiled into Rails app public directory.
Instance Method Summary collapse
-
#initialize(app_path, stylesheet_name) ⇒ CompiledStylesheetFile
constructor
Initializes new instance of the compiled stylesheet file.
-
#read ⇒ String
Reads content of the file.
Constructor Details
#initialize(app_path, stylesheet_name) ⇒ CompiledStylesheetFile
Initializes new instance of the compiled stylesheet file.
9 10 11 |
# File 'lib/roll/amp/style/compiled_stylesheet_file.rb', line 9 def initialize(app_path, stylesheet_name) @path = CompiledStylesheetPath.new(app_path, stylesheet_name) end |
Instance Method Details
#read ⇒ String
Reads content of the file. if file doesn’t exist.
16 17 18 19 20 21 22 23 24 |
# File 'lib/roll/amp/style/compiled_stylesheet_file.rb', line 16 def read full_stylesheet_path = @path.full if File.file?(full_stylesheet_path) && File.exist?(full_stylesheet_path) File.read(full_stylesheet_path) else '' end end |