Module: DataMapper::Sweatshop::ClassAttributes

### Home Classes Methods

### In Files

- lib/dm-sweatshop/support/class_attributes.rb

### Methods

- ::accessor
- ::reader
- ::writer

### Files

- LICENSE
- README.rdoc

### Class/Module Index

Quicksearch

- DataMapper
- DataMapper::Model
- DataMapper::Sweatshop
- DataMapper::Sweatshop::ClassAttributes
- DataMapper::Sweatshop::NoFixtureExist
- DataMapper::Sweatshop::Unique
- DataMapper::Sweatshop::Unique::TooManyTriesException
- DataMapper::Sweatshop::UniqueWorker

No matching classes.

# DataMapper::Sweatshop::ClassAttributes

### Public Class Methods

accessor(klass, *attributes) click to toggle source

    # File lib/dm-sweatshop/support/class_attributes.rb, line 40
    def self.accessor(klass, *attributes)
      self.reader(klass, *attributes)
      self.writer(klass, *attributes)
    end

reader(klass, *attributes) click to toggle source

    # File lib/dm-sweatshop/support/class_attributes.rb, line 4
    def self.reader(klass, *attributes)
      attributes.each do |attribute|
        klass.class_eval(            unless defined? @@#{attribute}              @@#{attribute} = nil            end            def self.#{attribute}              @@#{attribute}            end            def #{attribute}              @@#{attribute}            end, __FILE__, __LINE__ + 1)
      end
    end

writer(klass, *attributes) click to toggle source

    # File lib/dm-sweatshop/support/class_attributes.rb, line 22
    def self.writer(klass, *attributes)
      attributes.each do |attribute|
        klass.class_eval(            unless defined? @@#{attribute}              @@#{attribute} = nil            end            def self.#{attribute}=(obj)              @@#{attribute} = obj            end            def #{attribute}=(obj)              @@#{attribute} = obj            end, __FILE__, __LINE__ + 1)
      end
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.