Class: SnFoil::Adapters::ORMs::ActiveRecord

Inherits:
BaseAdapter
  • Object
show all
Defined in:
lib/snfoil/adapters/orms/active_record.rb

Instance Method Summary collapse

Methods inherited from BaseAdapter

#is_a?, #klass

Instance Method Details

#allObject



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

#destroyObject



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

#saveObject



31
32
33
# File 'lib/snfoil/adapters/orms/active_record.rb', line 31

def save
  __getobj__.save
end