Class: OpenStruct

### Home Classes Methods

### In Files

- lib/backports/2.0.0/stdlib/ostruct.rb

### Parent

Object

### Methods

- #[]
- #[]=
- #each_pair
- #eql?
- #hash
- #to_h

### Class/Module Index

Quicksearch

- Prime
- Prime::EratosthenesGenerator
- Prime::EratosthenesSieve
- Prime::Generator23
- Prime::OldCompatibility
- Prime::PseudoPrimeGenerator
- Prime::TrialDivision
- Prime::TrialDivisionGenerator
- Backports
- Backports::MOST_EXTREME_OBJECT_EVER
- Backports::StdLib
- Backports::StdLib::LoadedFeatures
- Enumerator
- Enumerator::GeneratorBP
- Enumerator::Lazy
- Enumerator::Yielder
- Matrix
- Matrix::EigenvalueDecomposition
- Matrix::LUPDecomposition
- Random
- Random::Implementation
- Random::MT19937
- Enumerable
- Enumerable::Enumerator
- File
- File::Constants
- ARGF
- Array
- BasicObject
- Binding
- Complex
- Dir
- ENV
- Fixnum
- Float
- GC
- Hash
- IO
- Integer
- Kernel
- Math
- Method
- Module
- NilClass
- Numeric
- Object
- ObjectSpace
- OpenStruct
- Proc
- Process
- Range
- Regexp
- Set
- StopIteration
- String
- Struct
- Symbol
- UnboundMethod

No matching classes.

# OpenStruct

### Public Instance Methods

[](name) click to toggle source

    # File lib/backports/2.0.0/stdlib/ostruct.rb, line 2
    def [](name)
      @table[name.to_sym]
    end

[]=(name, value) click to toggle source

    # File lib/backports/2.0.0/stdlib/ostruct.rb, line 6
    def []=(name, value)
      modifiable[new_ostruct_member(name)] = value
    end

each_pair() click to toggle source

    # File lib/backports/2.0.0/stdlib/ostruct.rb, line 19
    def each_pair
      return to_enum(:each_pair) unless block_given?
      @table.each_pair{|p| yield p}
    end

eql?(other) click to toggle source

    # File lib/backports/2.0.0/stdlib/ostruct.rb, line 10
    def eql?(other)
      return false unless other.kind_of?(OpenStruct)
      @table.eql?(other.table)
    end

hash() click to toggle source

    # File lib/backports/2.0.0/stdlib/ostruct.rb, line 15
    def hash
      @table.hash
    end

to_h() click to toggle source

    # File lib/backports/2.0.0/stdlib/ostruct.rb, line 24
    def to_h
      @table.dup
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.