Module: Commutator::Model::Attributes::ClassMethods
- Defined in:
- lib/commutator/model/attributes.rb
Overview
:nodoc:
Instance Method Summary collapse
Instance Method Details
#attribute(*attr_names) ⇒ Object
44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/commutator/model/attributes.rb', line 44 def attribute(*attr_names) = attr_names. attr_names.each do |attr_name| attribute_names << attr_name # Skip reader and writer methods entirely next if [:accessor] == false define_writer(attr_name, ) unless [:writer] == false attr_reader attr_name unless [:reader] == false end end |
#attribute_names ⇒ Object
58 59 60 |
# File 'lib/commutator/model/attributes.rb', line 58 def attribute_names @attribute_names ||= Set.new end |