Class: Emcee::Resolver
- Inherits:
-
Object
- Object
- Emcee::Resolver
- Defined in:
- lib/emcee/resolver.rb
Overview
Resolver is responsible for interfacing with Sprockets.
Instance Attribute Summary collapse
-
#directory ⇒ Object
readonly
Returns the value of attribute directory.
Instance Method Summary collapse
- #evaluate(path) ⇒ Object
-
#initialize(context) ⇒ Resolver
constructor
A new instance of Resolver.
- #require_asset(path) ⇒ Object
- #should_inline?(path) ⇒ Boolean
Constructor Details
#initialize(context) ⇒ Resolver
Returns a new instance of Resolver.
6 7 8 9 |
# File 'lib/emcee/resolver.rb', line 6 def initialize(context) @context = context @directory = File.dirname(context.pathname) end |
Instance Attribute Details
#directory ⇒ Object (readonly)
Returns the value of attribute directory.
4 5 6 |
# File 'lib/emcee/resolver.rb', line 4 def directory @directory end |
Instance Method Details
#evaluate(path) ⇒ Object
15 16 17 |
# File 'lib/emcee/resolver.rb', line 15 def evaluate(path) @context.evaluate(path) end |
#require_asset(path) ⇒ Object
11 12 13 |
# File 'lib/emcee/resolver.rb', line 11 def require_asset(path) @context.require_asset(path) end |
#should_inline?(path) ⇒ Boolean
19 20 21 |
# File 'lib/emcee/resolver.rb', line 19 def should_inline?(path) path !~ /\A\/\// end |