Module: Virtus::ClassMethods
- Includes:
- Extensions
- Defined in:
- lib/virtus/class_methods.rb
Overview
Class methods that are added when you include Virtus
Constant Summary
Constants included from Extensions
Extensions::INVALID_WRITER_METHODS, Extensions::WRITER_METHOD_REGEXP
Instance Method Summary collapse
-
#attribute_set ⇒ AttributeSet
Returns all the attributes defined on a Class.
- #attributes ⇒ Object deprecated Deprecated.
Methods included from Extensions
#allowed_writer_methods, #attribute
Instance Method Details
#attribute_set ⇒ AttributeSet
Returns all the attributes defined on a Class
41 42 43 44 45 46 47 |
# File 'lib/virtus/class_methods.rb', line 41 def attribute_set return @attribute_set if defined?(@attribute_set) superclass = self.superclass method = __method__ parent = superclass.public_send(method) if superclass.respond_to?(method) @attribute_set = AttributeSet.new(parent) end |
#attributes ⇒ Object
Deprecated.
54 55 56 57 |
# File 'lib/virtus/class_methods.rb', line 54 def attributes warn "#{self}.attributes is deprecated. Use #{self}.attribute_set instead: #{caller.first}" attribute_set end |