Class: ActiveRecord::Attr::Stripper::Target
- Inherits:
-
Object
- Object
- ActiveRecord::Attr::Stripper::Target
- Defined in:
- lib/activerecord/attr/stripper/target.rb
Instance Attribute Summary collapse
-
#attrs ⇒ Object
readonly
Returns the value of attribute attrs.
-
#opts ⇒ Object
readonly
Returns the value of attribute opts.
Instance Method Summary collapse
-
#initialize(*attrs) ⇒ Target
constructor
A new instance of Target.
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
#attrs ⇒ Object (readonly)
Returns the value of attribute attrs.
6 7 8 |
# File 'lib/activerecord/attr/stripper/target.rb', line 6 def attrs @attrs end |
#opts ⇒ Object (readonly)
Returns the value of attribute opts.
6 7 8 |
# File 'lib/activerecord/attr/stripper/target.rb', line 6 def opts @opts end |