Class: ActiveRecord::Attr::Stripper::Target

Inherits:
Object
  • Object
show all
Defined in:
lib/activerecord/attr/stripper/target.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*attrs) ⇒ Target

Returns a new instance of Target.



8
9
10
11
12
13
14
15
16
# File 'lib/activerecord/attr/stripper/target.rb', line 8

def initialize(*attrs)
  if attrs.last.kind_of?(Hash)
    @attrs = attrs[0...-1]
    @opts  = attrs.last
  else
    @attrs = attrs
    @opts  = {}
  end
end

Instance Attribute Details

#attrsObject (readonly)

Returns the value of attribute attrs.



6
7
8
# File 'lib/activerecord/attr/stripper/target.rb', line 6

def attrs
  @attrs
end

#optsObject (readonly)

Returns the value of attribute opts.



6
7
8
# File 'lib/activerecord/attr/stripper/target.rb', line 6

def opts
  @opts
end