### Home Classes Methods

### In Files

- lib/sass/tree/visitors/set_options.rb

### Parent

Sass::Tree::Visitors::Base

### Methods

- ::new
- ::visit
- #visit
- #visit_comment
- #visit_cssimport
- #visit_debug
- #visit_directive
- #visit_each
- #visit_error
- #visit_extend
- #visit_for
- #visit_function
- #visit_if
- #visit_import
- #visit_media
- #visit_mixin
- #visit_mixindef
- #visit_prop
- #visit_return
- #visit_rule
- #visit_supports
- #visit_variable
- #visit_warn
- #visit_while

### Class/Module Index

Quicksearch

- Sass
- Sass::BaseEnvironment
- Sass::CSS
- Sass::CacheStores
- Sass::CacheStores::Base
- Sass::CacheStores::Chain
- Sass::CacheStores::Filesystem
- Sass::CacheStores::Memory
- Sass::CacheStores::Null
- Sass::Callbacks
- Sass::Callbacks::InstanceMethods
- Sass::Engine
- Sass::Engine::Line
- Sass::Environment
- Sass::Exec
- Sass::Exec::Base
- Sass::Exec::SassConvert
- Sass::Exec::SassScss
- Sass::Exec::SassScss::Sass::Plugin.compiler
- Sass::Features
- Sass::Importers
- Sass::Importers::Base
- Sass::Importers::Filesystem
- Sass::Logger
- Sass::Logger::Base
- Sass::Logger::LogLevel
- Sass::Logger::LogLevel::ClassMethods
- Sass::Media
- Sass::Media::Query
- Sass::Media::QueryList
- Sass::Plugin
- Sass::Plugin::Compiler
- Sass::Plugin::Configuration
- Sass::Plugin::MerbBootLoader
- Sass::Plugin::Rack
- Sass::Plugin::StalenessChecker
- Sass::ReadOnlyEnvironment
- Sass::Repl
- Sass::SCSS
- Sass::SCSS::CssParser
- Sass::SCSS::Parser
- Sass::SCSS::RX
- Sass::SCSS::ScriptLexer
- Sass::SCSS::ScriptParser
- Sass::SCSS::StaticParser
- Sass::Script
- Sass::Script::CssLexer
- Sass::Script::CssParser
- Sass::Script::Functions
- Sass::Script::Functions::EvaluationContext
- Sass::Script::Lexer
- Sass::Script::Parser
- Sass::Script::Tree
- Sass::Script::Tree::Funcall
- Sass::Script::Tree::Interpolation
- Sass::Script::Tree::ListLiteral
- Sass::Script::Tree::Literal
- Sass::Script::Tree::MapLiteral
- Sass::Script::Tree::Node
- Sass::Script::Tree::Operation
- Sass::Script::Tree::Selector
- Sass::Script::Tree::StringInterpolation
- Sass::Script::Tree::UnaryOperation
- Sass::Script::Tree::Variable
- Sass::Script::Value
- Sass::Script::Value::ArgList
- Sass::Script::Value::Base
- Sass::Script::Value::Bool
- Sass::Script::Value::Color
- Sass::Script::Value::Helpers
- Sass::Script::Value::List
- Sass::Script::Value::Map
- Sass::Script::Value::Null
- Sass::Script::Value::Number
- Sass::Script::Value::String
- Sass::Selector
- Sass::Selector::AbstractSequence
- Sass::Selector::Attribute
- Sass::Selector::Class
- Sass::Selector::CommaSequence
- Sass::Selector::Element
- Sass::Selector::Id
- Sass::Selector::Parent
- Sass::Selector::Placeholder
- Sass::Selector::Pseudo
- Sass::Selector::Sequence
- Sass::Selector::Simple
- Sass::Selector::SimpleSequence
- Sass::Selector::Universal
- Sass::SemiGlobalEnvironment
- Sass::Shared
- Sass::Source
- Sass::Source::Map
- Sass::Source::Map::Mapping
- Sass::Source::Position
- Sass::Source::Range
- Sass::Stack
- Sass::Stack::Frame
- Sass::Supports
- Sass::Supports::Condition
- Sass::Supports::Declaration
- Sass::Supports::Interpolation
- Sass::Supports::Negation
- Sass::Supports::Operator
- Sass::SyntaxError
- Sass::Tree
- Sass::Tree::AtRootNode
- Sass::Tree::CharsetNode
- Sass::Tree::CommentNode
- Sass::Tree::ContentNode
- Sass::Tree::CssImportNode
- Sass::Tree::DebugNode
- Sass::Tree::DirectiveNode
- Sass::Tree::EachNode
- Sass::Tree::ErrorNode
- Sass::Tree::ExtendNode
- Sass::Tree::ForNode
- Sass::Tree::FunctionNode
- Sass::Tree::IfNode
- Sass::Tree::ImportNode
- Sass::Tree::KeyframeRuleNode
- Sass::Tree::MediaNode
- Sass::Tree::MixinDefNode
- Sass::Tree::MixinNode
- Sass::Tree::Node
- Sass::Tree::PropNode
- Sass::Tree::ReturnNode
- Sass::Tree::RootNode
- Sass::Tree::RuleNode
- Sass::Tree::SupportsNode
- Sass::Tree::TraceNode
- Sass::Tree::VariableNode
- Sass::Tree::Visitors
- Sass::Tree::Visitors::Base
- Sass::Tree::Visitors::CheckNesting
- Sass::Tree::Visitors::Convert
- Sass::Tree::Visitors::Cssize
- Sass::Tree::Visitors::Cssize::Bubble
- Sass::Tree::Visitors::DeepCopy
- Sass::Tree::Visitors::Extend
- Sass::Tree::Visitors::Perform
- Sass::Tree::Visitors::SetOptions
- Sass::Tree::Visitors::ToCss
- Sass::Tree::WarnNode
- Sass::Tree::WhileNode
- Sass::UnitConversionError
- Sass::Util
- Sass::Util::CrossPlatformRandom
- Sass::Util::MultibyteStringScanner
- Sass::Util::NormalizedMap
- Sass::Util::StaticConditionalContext
- Sass::Util::SubsetMap
- Sass::Util::Test
- Sass::Version
- ActionController
- ActionController::Base
- Object
- OrderedHash

No matching classes.

# Sass::Tree::Visitors::SetOptions

A visitor for setting options on the Sass tree

### Public Class Methods

new(options) click to toggle source

    # File lib/sass/tree/visitors/set_options.rb, line 9
    def initialize(options)
      @options = options
    end

visit(root, options) click to toggle source

@param root [Tree::Node] The root node of the tree to visit. @param options [{Symbol => Object}] The options has to set.

    # File lib/sass/tree/visitors/set_options.rb, line 5
    def self.visit(root, options); new(options).send(:visit, root); end

### Protected Instance Methods

visit(node) click to toggle source

    # File lib/sass/tree/visitors/set_options.rb, line 13
    def visit(node)
      node.instance_variable_set('@options', @options)
      super
    end

visit_comment(node) click to toggle source

    # File lib/sass/tree/visitors/set_options.rb, line 18
    def visit_comment(node)
      node.value.each {|c| c.options = @options if c.is_a?(Sass::Script::Tree::Node)}
      yield
    end

visit_cssimport(node) click to toggle source

    # File lib/sass/tree/visitors/set_options.rb, line 130
    def visit_cssimport(node)
      node.query.each {|c| c.options = @options if c.is_a?(Sass::Script::Tree::Node)} if node.query
      yield
    end

visit_debug(node) click to toggle source

    # File lib/sass/tree/visitors/set_options.rb, line 23
    def visit_debug(node)
      node.expr.options = @options
      yield
    end

visit_directive(node) click to toggle source

    # File lib/sass/tree/visitors/set_options.rb, line 120
    def visit_directive(node)
      node.value.each {|c| c.options = @options if c.is_a?(Sass::Script::Tree::Node)}
      yield
    end

visit_each(node) click to toggle source

    # File lib/sass/tree/visitors/set_options.rb, line 33
    def visit_each(node)
      node.list.options = @options
      yield
    end

visit_error(node) click to toggle source

    # File lib/sass/tree/visitors/set_options.rb, line 28
    def visit_error(node)
      node.expr.options = @options
      yield
    end

visit_extend(node) click to toggle source

    # File lib/sass/tree/visitors/set_options.rb, line 38
    def visit_extend(node)
      node.selector.each {|c| c.options = @options if c.is_a?(Sass::Script::Tree::Node)}
      yield
    end

visit_for(node) click to toggle source

    # File lib/sass/tree/visitors/set_options.rb, line 43
    def visit_for(node)
      node.from.options = @options
      node.to.options = @options
      yield
    end

visit_function(node) click to toggle source

    # File lib/sass/tree/visitors/set_options.rb, line 49
    def visit_function(node)
      node.args.each do |k, v|
        k.options = @options
        v.options = @options if v
      end
      node.splat.options = @options if node.splat
      yield
    end

visit_if(node) click to toggle source

    # File lib/sass/tree/visitors/set_options.rb, line 58
    def visit_if(node)
      node.expr.options = @options if node.expr
      visit(node.else) if node.else
      yield
    end

visit_import(node) click to toggle source

    # File lib/sass/tree/visitors/set_options.rb, line 64
    def visit_import(node)
      # We have no good way of propagating the new options through an Engine
      # instance, so we just null it out. This also lets us avoid caching an
      # imported Engine along with the importing source tree.
      node.imported_file = nil
      yield
    end

visit_media(node) click to toggle source

    # File lib/sass/tree/visitors/set_options.rb, line 125
    def visit_media(node)
      node.query.each {|c| c.options = @options if c.is_a?(Sass::Script::Tree::Node)}
      yield
    end

visit_mixin(node) click to toggle source

    # File lib/sass/tree/visitors/set_options.rb, line 81
    def visit_mixin(node)
      node.args.each {|a| a.options = @options}
      node.keywords.each {|k, v| v.options = @options}
      node.splat.options = @options if node.splat
      node.kwarg_splat.options = @options if node.kwarg_splat
      yield
    end

visit_mixindef(node) click to toggle source

    # File lib/sass/tree/visitors/set_options.rb, line 72
    def visit_mixindef(node)
      node.args.each do |k, v|
        k.options = @options
        v.options = @options if v
      end
      node.splat.options = @options if node.splat
      yield
    end

visit_prop(node) click to toggle source

    # File lib/sass/tree/visitors/set_options.rb, line 89
    def visit_prop(node)
      node.name.each {|c| c.options = @options if c.is_a?(Sass::Script::Tree::Node)}
      node.value.options = @options
      yield
    end

visit_return(node) click to toggle source

    # File lib/sass/tree/visitors/set_options.rb, line 95
    def visit_return(node)
      node.expr.options = @options
      yield
    end

visit_rule(node) click to toggle source

    # File lib/sass/tree/visitors/set_options.rb, line 100
    def visit_rule(node)
      node.rule.each {|c| c.options = @options if c.is_a?(Sass::Script::Tree::Node)}
      yield
    end

visit_supports(node) click to toggle source

    # File lib/sass/tree/visitors/set_options.rb, line 135
    def visit_supports(node)
      node.condition.options = @options
      yield
    end

visit_variable(node) click to toggle source

    # File lib/sass/tree/visitors/set_options.rb, line 105
    def visit_variable(node)
      node.expr.options = @options
      yield
    end

visit_warn(node) click to toggle source

    # File lib/sass/tree/visitors/set_options.rb, line 110
    def visit_warn(node)
      node.expr.options = @options
      yield
    end

visit_while(node) click to toggle source

    # File lib/sass/tree/visitors/set_options.rb, line 115
    def visit_while(node)
      node.expr.options = @options
      yield
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.