Class: PDF::Writer::OHash

### Home Classes Methods

### In Files

- lib/pdf/writer/ohash.rb

### Parent

Hash

### Methods

- ::new
- #[]=
- #delete
- #each
- #each_key
- #each_pair
- #each_value
- #first
- #first?
- #last
- #last?
- #store

### Files

- ChangeLog

### Class/Module Index

Quicksearch

- PDF
- PDF::Charts
- PDF::Charts::StdDev
- PDF::Charts::StdDev::Label
- PDF::Charts::StdDev::Marker
- PDF::Charts::StdDev::Scale
- PDF::Math
- PDF::QuickRef
- PDF::SimpleTable
- PDF::SimpleTable::Column
- PDF::SimpleTable::Column::Heading
- PDF::TechBook
- PDF::TechBook::TagTocDots
- PDF::TechBook::TagXref
- PDF::Writer
- PDF::Writer::ARC4
- PDF::Writer::Complex
- PDF::Writer::External
- PDF::Writer::FontMetrics
- PDF::Writer::Graphics
- PDF::Writer::Graphics::ImageInfo
- PDF::Writer::Graphics::ImageInfo::Formats
- PDF::Writer::Graphics::ImageInfo::Type
- PDF::Writer::Lang
- PDF::Writer::Lang::EN
- PDF::Writer::OHash
- PDF::Writer::Object
- PDF::Writer::Object::Action
- PDF::Writer::Object::Annotation
- PDF::Writer::Object::Catalog
- PDF::Writer::Object::Contents
- PDF::Writer::Object::Destination
- PDF::Writer::Object::Encryption
- PDF::Writer::Object::Font
- PDF::Writer::Object::FontDescriptor
- PDF::Writer::Object::FontEncoding
- PDF::Writer::Object::Info
- PDF::Writer::Object::Outline
- PDF::Writer::Object::Outlines
- PDF::Writer::Object::Pages
- PDF::Writer::Object::Procset
- PDF::Writer::Object::ViewerPreferences
- PDF::Writer::OffsetReader
- PDF::Writer::PolygonPoint
- PDF::Writer::State
- PDF::Writer::StateStack
- PDF::Writer::StrokeStyle

No matching classes.

# PDF::Writer::OHash

Based on [ruby-talk:20551]. Updated to (hopefully) be 1.8 friendly.

### Public Class Methods

new(*args) click to toggle source

    # File lib/pdf/writer/ohash.rb, line 16
    def initialize(*args)
      @keys = []
      super
    end

### Public Instance Methods

[]=(key, val) click to toggle source

    # File lib/pdf/writer/ohash.rb, line 21
    def []=(key, val)
      @keys << key unless has_key?(key)
      super
    end

Also aliased as: store
delete(key) click to toggle source

    # File lib/pdf/writer/ohash.rb, line 26
    def delete(key)
      @keys.delete(key) if has_key?(key)
      super
    end

each() click to toggle source

    # File lib/pdf/writer/ohash.rb, line 31
    def each
      @keys.each { |k| yield k, self[k] }
    end

Also aliased as: each_pair
each_key() click to toggle source

    # File lib/pdf/writer/ohash.rb, line 35
    def each_key
      @keys.each { |k| yield k }
    end

each_pair() click to toggle source
Alias for: each
each_value() click to toggle source

    # File lib/pdf/writer/ohash.rb, line 39
    def each_value
      @keys.each { |k| yield self[k] }
    end

first() click to toggle source

    # File lib/pdf/writer/ohash.rb, line 43
    def first
      self[@keys[0]]
    end

first?(item) click to toggle source

    # File lib/pdf/writer/ohash.rb, line 51
    def first?(item)
      self[@keys[0]] == item
    end

last() click to toggle source

    # File lib/pdf/writer/ohash.rb, line 47
    def last
      self[@keys[-1]]
    end

last?(item) click to toggle source

    # File lib/pdf/writer/ohash.rb, line 55
    def last?(item)
      self[@keys[-1]] == item
    end

store(key, val) click to toggle source
Alias for: []=

[Validate]

Generated with the Darkfish Rdoc Generator 2.