Class: Sass::Rails::Resolver
- Inherits:
-
Object
- Object
- Sass::Rails::Resolver
- Defined in:
- lib/sass/rails/template_handlers.rb
Instance Attribute Summary collapse
-
#context ⇒ Object
Returns the value of attribute context.
Instance Method Summary collapse
-
#initialize(context) ⇒ Resolver
constructor
A new instance of Resolver.
- #process(path) ⇒ Object
- #public_path(path, scope) ⇒ Object
- #resolve(path, content_type = :self) ⇒ Object
Constructor Details
#initialize(context) ⇒ Resolver
Returns a new instance of Resolver.
10 11 12 |
# File 'lib/sass/rails/template_handlers.rb', line 10 def initialize(context) @context = context end |
Instance Attribute Details
#context ⇒ Object
Returns the value of attribute context.
8 9 10 |
# File 'lib/sass/rails/template_handlers.rb', line 8 def context @context end |
Instance Method Details
#process(path) ⇒ Object
26 27 28 |
# File 'lib/sass/rails/template_handlers.rb', line 26 def process(path) context.environment[path].to_s end |
#public_path(path, scope) ⇒ Object
22 23 24 |
# File 'lib/sass/rails/template_handlers.rb', line 22 def public_path(path, scope) context.asset_paths.compute_public_path(path, scope) end |
#resolve(path, content_type = :self) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/sass/rails/template_handlers.rb', line 14 def resolve(path, content_type = :self) = {} [:content_type] = content_type unless content_type.nil? context.resolve(path, ) rescue Sprockets::FileNotFound, Sprockets::ContentTypeMismatch nil end |