Class: AttributeExtras::AttributeExtra

Inherits:
Module
  • Object
show all
Defined in:
lib/attribute_extras.rb

Overview

Parent class of the various extras.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, attributes, perform) ⇒ AttributeExtra

Returns a new instance of AttributeExtra.



11
12
13
14
# File 'lib/attribute_extras.rb', line 11

def initialize(name, attributes, perform)
  @name = name
  define_extra(name, attributes, perform)
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



9
10
11
# File 'lib/attribute_extras.rb', line 9

def name
  @name
end

Instance Method Details

#included(clazz) ⇒ Object



16
17
18
# File 'lib/attribute_extras.rb', line 16

def included(clazz)
  clazz.before_validation(name)
end