Module: DCGOV::EasyClassMaker::ClassMethods

Defined in:
lib/dcgov/easy_class_maker.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.attributesObject

read method for attributes class variable



21
# File 'lib/dcgov/easy_class_maker.rb', line 21

def self.attributes; @@attributes end

Instance Method Details

#attributes(*attrs) ⇒ Object

creates the attributes class variable and creates each attribute’s accessor methods



15
16
17
18
# File 'lib/dcgov/easy_class_maker.rb', line 15

def attributes(*attrs)
  @@attributes = attrs
  @@attributes.each { |a| attr_accessor a }
end