Module: Sass::Extras::Variables
- Defined in:
- lib/sass/extras/variables.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#global_variable_get($name) ⇒ Sass::Script::Value::Bool
Check whether a variable with the given name exists in the global scope (at the top level of the file).
-
#variable_get($name) ⇒ Sass::Script::Value::Bool
Get the value of a variable with the given name, if it exists in the current scope or in the global scope.
Class Method Details
.included(base) ⇒ Object
4 5 6 7 |
# File 'lib/sass/extras/variables.rb', line 4 def self.included(base) base.declare :variable_get, [:name] base.declare :global_variable_get, [:name] end |
Instance Method Details
#global_variable_get($name) ⇒ Sass::Script::Value::Bool
Check whether a variable with the given name exists in the global scope (at the top level of the file).
45 46 47 48 |
# File 'lib/sass/extras/variables.rb', line 45 def global_variable_get(name) assert_type name, :String, :name environment.global_env.var(name.value) end |
#variable_get($name) ⇒ Sass::Script::Value::Bool
Get the value of a variable with the given name, if it exists in the current scope or in the global scope.
23 24 25 26 |
# File 'lib/sass/extras/variables.rb', line 23 def variable_get(name) assert_type name, :String, :name environment.caller.var(name.value) end |