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
-
.attributes ⇒ Object
read method for attributes class variable.
Instance Method Summary collapse
-
#attributes(*attrs) ⇒ Object
creates the attributes class variable and creates each attribute’s accessor methods.
Class Method Details
.attributes ⇒ Object
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 |