Class: Sass::Script::Variable
Overview
:nodoc:
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name) ⇒ Variable
constructor
A new instance of Variable.
- #inspect ⇒ Object
- #perform(environment) ⇒ Object
Constructor Details
#initialize(name) ⇒ Variable
Returns a new instance of Variable.
6 7 8 |
# File 'lib/sass/script/variable.rb', line 6 def initialize(name) @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/sass/script/variable.rb', line 4 def name @name end |
Instance Method Details
#inspect ⇒ Object
10 11 12 |
# File 'lib/sass/script/variable.rb', line 10 def inspect "!#{name}" end |
#perform(environment) ⇒ Object
14 15 16 17 |
# File 'lib/sass/script/variable.rb', line 14 def perform(environment) (val = environment.var(name)) && (return val) raise SyntaxError.new("Undefined variable: \"!#{name}\".") end |