### Home Classes Methods

### In Files

- lib/facets/object/replace.rb
- lib/facets/object/object_state.rb
- lib/facets/struct/attributes.rb

### Parent

Object

### Methods

- #attributes
- #object_state
- #replace

### Files

- README.rdoc

### Class/Module Index

Quicksearch

- Lazy
- Lazy::Future
- Lazy::Promise
- Lazy::Promise::DIVERGES
- Lazy::PromiseSafe
- Enumerable
- Enumerable::Recursor
- Method
- Method::Composition
- Module
- Module::InstanceFunction
- Array
- Binding
- Class
- Comparable
- Denumerable
- Denumerator
- Dir
- Enumerator
- Exception
- Facets
- FalseClass
- File
- FileTest
- Fixnum
- Float
- Functor
- Hash
- Indexable
- Instance
- Integer
- Kernel
- MatchData
- NA
- NilClass
- Numeric
- Object
- ObjectSpace
- Proc
- Process
- Range
- Regexp
- String
- Struct
- Symbol
- Time
- TrueClass
- UnboundMethod

No matching classes.

# Struct

### Public Instance Methods

attributes() click to toggle source

Returns a hash containing the names and values for all instance settings in the Struct.

This will eventually be deprecated in favor of to_h.

    # File lib/facets/struct/attributes.rb, line 8
    def attributes
      h = {}
      each_pair { |k,v| h[k] = v }
      h
    end

object_state(data=nil) click to toggle source

    # File lib/facets/object/object_state.rb, line 68
    def object_state(data=nil)
      if data
        data.each_pair {|k,v| send(k.to_s + "=", v)}
      else
        data = {}
        each_pair{|k,v| data[k] = v}
        data
      end
    end

replace(source) click to toggle source

Struct#replace can take any `source` that responds to each_pair.

    # File lib/facets/object/replace.rb, line 39
    def replace(source)
      source.each_pair{ |k,v| send(k.to_s + "=", v) }
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.