Class: Sass::SemiGlobalEnvironment
- Inherits:
- Environment
- Object
- BaseEnvironment
- Environment
- Sass::SemiGlobalEnvironment
- Defined in:
- /Users/ceppstei/Projects/sass-lang/.sass/lib/sass/environment.rb
Overview
An environment that can write to in-scope global variables, but doesn’t create new variables in the global scope. Useful for top-level control directives.
Instance Attribute Summary
Attributes inherited from Environment
Attributes inherited from BaseEnvironment
#caller, #content, #options, #selector
Instance Method Summary (collapse)
Methods inherited from BaseEnvironment
#global?, #global_env, inherited_hash_accessor, inherited_hash_reader, inherited_hash_writer, #initialize, #stack
Constructor Details
This class inherits a constructor from Sass::BaseEnvironment
Instance Method Details
- try_set_var(name, value)
203 204 205 206 207 208 209 210 211 212 213 | # File '/Users/ceppstei/Projects/sass-lang/.sass/lib/sass/environment.rb', line 203
def try_set_var(name, value)
@vars ||= {}
if @vars.include?(name)
@vars[name] = value
true
elsif @parent
@parent.try_set_var(name, value)
else
false
end
end |