Class: SnFoil::Adapters::ORMs::ActiveRecord
- Inherits:
-
BaseAdapter
- Object
- SimpleDelegator
- BaseAdapter
- SnFoil::Adapters::ORMs::ActiveRecord
- Defined in:
- lib/snfoil/adapters/orms/active_record.rb
Instance Method Summary collapse
- #all ⇒ Object
- #attributes=(attributes) ⇒ Object
- #destroy ⇒ Object
- #new(**params) ⇒ Object
- #save ⇒ Object
Methods inherited from BaseAdapter
Instance Method Details
#all ⇒ Object
27 28 29 |
# File 'lib/snfoil/adapters/orms/active_record.rb', line 27 def all __getobj__.all end |
#attributes=(attributes) ⇒ Object
40 41 42 |
# File 'lib/snfoil/adapters/orms/active_record.rb', line 40 def attributes=(attributes) __getobj__.attributes = attributes end |
#destroy ⇒ Object
35 36 37 38 |
# File 'lib/snfoil/adapters/orms/active_record.rb', line 35 def destroy __getobj__.destroy __getobj__.destroyed? end |
#new(**params) ⇒ Object
23 24 25 |
# File 'lib/snfoil/adapters/orms/active_record.rb', line 23 def new(**params) self.class.new(__getobj__.new(params)) end |
#save ⇒ Object
31 32 33 |
# File 'lib/snfoil/adapters/orms/active_record.rb', line 31 def save __getobj__.save end |