Class: Sass::Script::Variable

Inherits:
Object
  • Object
show all
Defined in:
lib/sass/script/variable.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#nameObject (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

#inspectObject



10
11
12
# File 'lib/sass/script/variable.rb', line 10

def inspect
  "!#{name}"
end

#perform(environment) ⇒ Object

Raises:



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