### Home Classes Methods

### In Files

- lib/graphviz/core_ext.rb

### Parent

Object

### Methods

- #each_except
- #symbolize_keys

### Files

- AUTHORS
- COPYING
- README.rdoc

### Class/Module Index

Quicksearch

- GraphViz
- GraphViz::Attrs
- GraphViz::Edge
- GraphViz::Elements
- GraphViz::Ext
- GraphViz::FamilyTree
- GraphViz::FamilyTree::Couple
- GraphViz::FamilyTree::Generation
- GraphViz::FamilyTree::Person
- GraphViz::FamilyTree::Sibling
- GraphViz::GraphML
- GraphViz::Math
- GraphViz::Math::CoordinateError
- GraphViz::Math::Matrix
- GraphViz::Math::ValueError
- GraphViz::Node
- GraphViz::Theory
- GraphViz::Types
- GraphViz::Types::Common
- GraphViz::Types::EscString
- GraphViz::Types::GvDouble
- GraphViz::Types::HtmlString
- GraphViz::Types::LblString
- GraphViz::XML
- Constants
- GVUtils
- Hash
- Object
- String

No matching classes.

# Hash

From : www.geekmade.co.uk/2008/09/ruby-tip-normalizing-hash-keys-as-symbols/

### Public Instance Methods

each_except( e, &b ) click to toggle source

x = {

    :none => String,
    :png => "file.png",
    :svg => "file.svg"

}

x.each_except( :key => [:none], :value => [/.png$/] ) do |k, v|

    puts "#{k} -> #{v}"

end

# > svg -> file.svg

    # File lib/graphviz/core_ext.rb, line 32
    def each_except( e, &b )
      key_table = (e[:key]||[]).clone.delete_if {|i| i.kind_of? Regexp }
      key_regexp = (e[:key]||[]).clone.delete_if {|i| key_table.include? i }.map {|i| i.to_s }.join("|")

      value_table = (e[:value]||[]).clone.delete_if {|i| i.kind_of? Regexp }
      value_regexp = (e[:value]||[]).clone.delete_if {|i| value_table.include? i }.map {|i| i.to_s }.join("|")

      self.each do |k, v|
        yield( k, v ) unless (key_table.size > 0 and key_table.include?(k)) or (key_regexp.size > 0 and k.to_s.match(key_regexp)) or (value_table.size > 0 and value_table.include?(v)) or (value_regexp.size > 0 and v.to_s.match(value_regexp))
      end
    end

symbolize_keys() click to toggle source

    # File lib/graphviz/core_ext.rb, line 14
    def symbolize_keys
      inject({}) do |options, (key, value)|
        options[(key.to_sym rescue key) || key] = value
        options
      end
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.