Module | Virtus::Attribute::Accessor |
In: |
lib/virtus/attribute/accessor.rb
|
Accessor extension provides methods to read and write attributes
@example
attribute = Virtus::Attribute.build(String, :name => :email) model = Class.new { attr_reader :email } object = model.new attribute.set(object, 'jane@doe.com') attribute.get(object) # => 'jane@doe.com'
instance_variable_name | [R] |
Return instance_variable_name used by this accessor
@api private |
name | [R] |
Return name of this accessor attribute
@return [Symbol] @api public |
Set value of the attribute
@param [Object] instance @param [Object] value
@return [Object] value that was set
@api public