Class Sass::Script::Functions::EvaluationContext
In: lib/sass/script/functions.rb
Parent: Object
Haml::Util Engine Color SyntaxError UnitConversionError StandardError AbstractSequence CommaSequence Sequence SimpleSequence Simple Parent Universal Class SelectorPseudoClass Id Pseudo Attribute Interpolation Element Node Operation Literal UnaryOperation StringInterpolation Funcall Interpolation Variable Lexer CssLexer Number Bool String Parser Parser CssParser EvaluationContext StaticParser SassParser CssParser Node DebugNode IfNode CommentNode ForNode PropNode MixinNode DirectiveNode ExtendNode VariableNode WarnNode RootNode WhileNode RuleNode MixinDefNode Enumerable ImportNode Merb::BootLoader MerbBootLoader Repl CSS Environment Rack StalenessChecker lib/sass/repl.rb lib/sass/css.rb lib/sass/environment.rb lib/sass/error.rb lib/sass/engine.rb lib/sass/selector/simple_sequence.rb lib/sass/selector/abstract_sequence.rb lib/sass/selector/sequence.rb lib/sass/selector/comma_sequence.rb lib/sass/selector/simple.rb lib/sass/selector.rb Selector lib/sass/script/css_parser.rb lib/sass/script/lexer.rb lib/sass/script/color.rb lib/sass/script/string.rb lib/sass/script/unary_operation.rb lib/sass/script/variable.rb lib/sass/script/funcall.rb lib/sass/script/string_interpolation.rb lib/sass/script/operation.rb lib/sass/script/bool.rb lib/sass/script/parser.rb lib/sass/script/literal.rb lib/sass/script/node.rb lib/sass/script/interpolation.rb lib/sass/script/css_lexer.rb lib/sass/script/number.rb lib/sass/script/functions.rb Functions Script lib/sass/scss/sass_parser.rb lib/sass/scss/static_parser.rb lib/sass/scss/parser.rb lib/sass/scss/css_parser.rb ScriptLexer ScriptParser RX SCSS Files Callbacks lib/sass/tree/while_node.rb lib/sass/tree/if_node.rb lib/sass/tree/mixin_def_node.rb lib/sass/tree/debug_node.rb lib/sass/tree/root_node.rb lib/sass/tree/for_node.rb lib/sass/tree/import_node.rb lib/sass/tree/prop_node.rb lib/sass/tree/node.rb lib/sass/tree/comment_node.rb lib/sass/tree/extend_node.rb lib/sass/tree/mixin_node.rb lib/sass/tree/warn_node.rb lib/sass/tree/directive_node.rb lib/sass/tree/rule_node.rb lib/sass/tree/variable_node.rb Tree lib/sass/plugin/rack.rb lib/sass/plugin/staleness_checker.rb lib/sass/plugin/merb.rb Plugin Sass dot/m_85_0.png

The context in which methods in {Script::Functions} are evaluated. That means that all instance methods of {EvaluationContext} are available to use in functions.

Methods

assert_type   new  

Included Modules

Sass::Script::Functions

Attributes

options  [R]  The options hash for the {Sass::Engine} that is processing the function call

@return [{Symbol => Object}]

Public Class methods

@param options [{Symbol => Object}] See \{options}

[Source]

     # File lib/sass/script/functions.rb, line 179
179:       def initialize(options)
180:         @options = options
181: 
182:         # We need to include this individually in each instance
183:         # because of an icky Ruby restriction
184:         class << self; include Sass::Script::Functions; end
185:       end

Public Instance methods

Asserts that the type of a given SassScript value is the expected type (designated by a symbol). For example:

    assert_type value, :String
    assert_type value, :Number

Valid types are `:Bool`, `:Color`, `:Number`, and `:String`. Note that `:String` will match both double-quoted strings and unquoted identifiers.

@param value [Sass::Script::Literal] A SassScript value @param type [Symbol] The name of the type the value is expected to be

[Source]

     # File lib/sass/script/functions.rb, line 200
200:       def assert_type(value, type)
201:         return if value.is_a?(Sass::Script.const_get(type))
202:         raise ArgumentError.new("#{value.inspect} is not a #{type.to_s.downcase}")
203:       end

[Validate]