Sha256: cdb9fe1bc79a3fa76936ab80a50ffa7bce56817473355fbe76794ee2bd524e76
Contents?: true
Size: 1.08 KB
Versions: 17
Compression:
Stored size: 1.08 KB
Contents
module Sass class Environment attr_reader :parent attr_writer :options def initialize(parent = nil) @vars = {} @mixins = {} @parent = parent set_var("important", Script::String.new("!important")) unless @parent end def options @options || (parent && parent.options) || {} end def self.inherited_hash(name) class_eval <<RUBY, __FILE__, __LINE__ + 1 def #{name}(name) @#{name}s[name] || @parent && @parent.#{name}(name) end def set_#{name}(name, value) @#{name}s[name] = value unless try_set_#{name}(name, value) end def try_set_#{name}(name, value) if @#{name}s.include?(name) @#{name}s[name] = value true elsif @parent @parent.try_set_#{name}(name, value) else false end end protected :try_set_#{name} def set_local_#{name}(name, value) @#{name}s[name] = value end RUBY end inherited_hash :var inherited_hash :mixin end end
Version data entries
17 entries across 17 versions & 2 rubygems