Virtus module that can define attributes for later inclusion
@private
@api private
# File lib/virtus/module_extensions.rb, line 10 def self.extended(mod) super setup(mod) end
@api private
# File lib/virtus/module_extensions.rb, line 16 def self.setup(mod, inclusions = [Model], attribute_definitions = []) mod.instance_variable_set('@inclusions', inclusions) existing_attributes = mod.instance_variable_get('@attribute_definitions') new_attributes = (existing_attributes || []) + attribute_definitions mod.instance_variable_set('@attribute_definitions', new_attributes) end
Define an attribute in the module
@see Virtus::Extensions#attribute
@return [self]
@api private
# File lib/virtus/module_extensions.rb, line 30 def attribute(name, type = nil, options = {}) @attribute_definitions << [name, type, options] self end
Generated with the Darkfish Rdoc Generator 2.