Class: Sass::Rails::Resolver

Inherits:
Object
  • Object
show all
Defined in:
lib/sass/rails/template_handlers.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#contextObject

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)
  options = {}
  options[:content_type] = content_type unless content_type.nil?
  context.resolve(path, options)
rescue Sprockets::FileNotFound, Sprockets::ContentTypeMismatch
  nil
end