Class: Tipsy::Handler::SassHandler::Resolver
- Inherits:
-
Object
- Object
- Tipsy::Handler::SassHandler::Resolver
- Defined in:
- lib/tipsy/handler/sass/resolver.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.
8 9 10 |
# File 'lib/tipsy/handler/sass/resolver.rb', line 8 def initialize(context) @context = context end |
Instance Attribute Details
#context ⇒ Object
Returns the value of attribute context.
6 7 8 |
# File 'lib/tipsy/handler/sass/resolver.rb', line 6 def context @context end |
Instance Method Details
#process(path) ⇒ Object
24 25 26 |
# File 'lib/tipsy/handler/sass/resolver.rb', line 24 def process(path) context.environment[path].to_s end |
#public_path(path, scope) ⇒ Object
20 21 22 |
# File 'lib/tipsy/handler/sass/resolver.rb', line 20 def public_path(path, scope) context.asset_paths.compute_public_path(path, scope) end |
#resolve(path, content_type = :self) ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/tipsy/handler/sass/resolver.rb', line 12 def resolve(path, content_type = :self) = {} [:content_type] = content_type unless content_type.nil? context.resolve(path, ) rescue Sprockets::FileNotFound, Sprockets::ContentTypeMismatch nil end |