Module: Jeckle::AttributeAliasing

Defined in:
lib/jeckle/attribute_aliasing.rb

Instance Method Summary collapse

Instance Method Details

#attribute(name, coercion, options = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/jeckle/attribute_aliasing.rb', line 3

def attribute(name, coercion, options = {})
  if custom_name = options.delete(:as)
    super(custom_name, coercion, options)

    alias_attribute name, custom_name
  else
    super
  end
end