Class: CSSPool::Visitors::Visitor

### Home Classes Methods

### In Files

- lib/csspool/visitors/visitor.rb

### Parent

Object

### Methods

- ::visitor_for
- #accept

### Files

- CHANGELOG.rdoc
- Manifest.txt
- README.rdoc

### Class/Module Index

Quicksearch

- CSSPool
- CSSPool::CSS
- CSSPool::CSS::Charset
- CSSPool::CSS::Declaration
- CSSPool::CSS::Document
- CSSPool::CSS::DocumentHandler
- CSSPool::CSS::ImportRule
- CSSPool::CSS::Media
- CSSPool::CSS::Parser
- CSSPool::CSS::RuleSet
- CSSPool::CSS::Tokenizer
- CSSPool::CSS::Tokenizer::ScanError
- CSSPool::Collection
- CSSPool::Node
- CSSPool::SAC
- CSSPool::SAC::Document
- CSSPool::SAC::Parser
- CSSPool::Selector
- CSSPool::Selectors
- CSSPool::Selectors::Additional
- CSSPool::Selectors::Attribute
- CSSPool::Selectors::Class
- CSSPool::Selectors::Id
- CSSPool::Selectors::PseudoClass
- CSSPool::Selectors::Simple
- CSSPool::Selectors::Type
- CSSPool::Selectors::Universal
- CSSPool::Terms
- CSSPool::Terms::Function
- CSSPool::Terms::Hash
- CSSPool::Terms::Ident
- CSSPool::Terms::Number
- CSSPool::Terms::Rgb
- CSSPool::Terms::String
- CSSPool::Terms::URI
- CSSPool::Visitors
- CSSPool::Visitors::Children
- CSSPool::Visitors::Comparable
- CSSPool::Visitors::Iterator
- CSSPool::Visitors::ToCSS
- CSSPool::Visitors::ToMinifiedCSS
- CSSPool::Visitors::Visitor

No matching classes.

# CSSPool::Visitors::Visitor

### Public Class Methods

visitor_for(*klasses, &block) click to toggle source

    # File lib/csspool/visitors/visitor.rb, line 4
    def self.visitor_for *klasses, &block
      klasses.each do |klass|
        method_name = klass.name.split('::').join('_')
        define_method(:"visit_#{method_name}", block)
      end
    end

### Public Instance Methods

accept(target) click to toggle source

    # File lib/csspool/visitors/visitor.rb, line 11
    def accept target
      method_name = target.class.name.split('::').join('_')
      send(:"visit_#{method_name}", target)
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.