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'

Methods

Attributes

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

Public Class methods

Public Instance methods

Return if attribute value is defined

@param [Object] instance

@return [Boolean]

@api public

Return value of the attribute

@param [Object] instance

@return [Object]

@api public

Returns a Boolean indicating whether the reader method is public

@return [Boolean]

@api private

Returns a Boolean indicating whether the writer method is public

@return [Boolean]

@api private

Set value of the attribute

@param [Object] instance @param [Object] value

@return [Object] value that was set

@api public

Set default value

@param [Object] instance

@return [Object] value that was set

@api public

[Validate]