Module: Virtus::Extensions::Methods
- Included in:
- ClassMethods
- Defined in:
- lib/virtus/extensions.rb
Instance Method Summary collapse
-
#allowed_writer_methods ⇒ Set
private
The list of writer methods that can be mass-assigned to in #attributes=.
-
#attribute(name, type = nil, options = {}) ⇒ self
Defines an attribute on an object’s class or instance.
- #values(&block) ⇒ Object
Instance Method Details
#allowed_writer_methods ⇒ Set
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
The list of writer methods that can be mass-assigned to in #attributes=
82 83 84 85 86 87 88 89 |
# File 'lib/virtus/extensions.rb', line 82 def allowed_writer_methods @allowed_writer_methods ||= begin allowed_writer_methods = allowed_methods.grep(WRITER_METHOD_REGEXP).to_set allowed_writer_methods -= INVALID_WRITER_METHODS allowed_writer_methods.freeze end end |