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.