Module: Entasis::Model::ClassMethods
- Defined in:
- lib/entasis/model.rb
Instance Method Summary collapse
-
#attributes(*attrs) ⇒ Object
Takes a list of attribute names.
Instance Method Details
#attributes(*attrs) ⇒ Object
Takes a list of attribute names.
Last argument can be an options hash:
strict: true - Raise UnknownAttributeError when given an unknown attribute.
24 25 26 27 28 29 30 |
# File 'lib/entasis/model.rb', line 24 def attributes(*attrs) self.attributes_config = attrs.last.is_a?(Hash) ? attrs.pop : {} self.attribute_names += attrs.map(&:to_s).sort attr_accessor *attrs end |