Class: Sass::Util::StaticConditionalContext

Inherits:
Object
  • Object
show all
Defined in:
/Users/ceppstei/Projects/sass-lang/.sass/lib/sass/util.rb

Overview

The context in which the ERB for #def_static_method will be run.

Instance Method Summary (collapse)

Constructor Details

- (StaticConditionalContext) initialize(set)

Returns a new instance of StaticConditionalContext

Parameters:

  • set (#include?)

    The set of variables that are defined for this context.



1197
1198
1199
# File '/Users/ceppstei/Projects/sass-lang/.sass/lib/sass/util.rb', line 1197

def initialize(set)
  @set = set
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

- (Boolean) method_missing(name, *args)

Checks whether or not a variable is defined for this context.

Parameters:

  • name (Symbol)

    The name of the variable

Returns:

  • (Boolean)


1205
1206
1207
1208
# File '/Users/ceppstei/Projects/sass-lang/.sass/lib/sass/util.rb', line 1205

def method_missing(name, *args)
  super unless args.empty? && !block_given?
  @set.include?(name)
end