Module: RealEx::Initializer::ClassMethods

Defined in:
lib/real_ex/initializer.rb

Overview

this blatantly ripped from jnunemaker’s Twitter gem. Thanks John!

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.attributesObject

read method for attributes class variable



17
# File 'lib/real_ex/initializer.rb', line 17

def self.attributes; @@attributes end

Instance Method Details

#attributes(*attrs) ⇒ Object

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



11
12
13
14
# File 'lib/real_ex/initializer.rb', line 11

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