mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
20 lines
369 B
Ruby
20 lines
369 B
Ruby
module Sass
|
|
module Script
|
|
class Variable # :nodoc:
|
|
attr_reader :name
|
|
|
|
def initialize(name)
|
|
@name = name
|
|
end
|
|
|
|
def inspect
|
|
"!#{name}"
|
|
end
|
|
|
|
def perform(environment)
|
|
(val = environment.var(name)) && (return val)
|
|
raise SyntaxError.new("Undefined variable: \"!#{name}\".")
|
|
end
|
|
end
|
|
end
|
|
end
|