Class: SnFoil::Adapters::ORMs::BaseAdapter

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/snfoil/adapters/orms/base_adapter.rb

Direct Known Subclasses

ActiveRecord

Instance Method Summary collapse

Instance Method Details

#allObject

Raises:

  • (NotImplementedError)


27
28
29
# File 'lib/snfoil/adapters/orms/base_adapter.rb', line 27

def all
  raise NotImplementedError, '#all not implemented in adapter'
end

#attributes=(_attributes) ⇒ Object

Raises:

  • (NotImplementedError)


39
40
41
# File 'lib/snfoil/adapters/orms/base_adapter.rb', line 39

def attributes=(_attributes)
  raise NotImplementedError, '#attributes= not implemented in adapter'
end

#destroyObject

Raises:

  • (NotImplementedError)


35
36
37
# File 'lib/snfoil/adapters/orms/base_adapter.rb', line 35

def destroy
  raise NotImplementedError, '#destroy not implemented in adapter'
end

#is_a?(check_class) ⇒ Boolean

Returns:

  • (Boolean)


43
44
45
# File 'lib/snfoil/adapters/orms/base_adapter.rb', line 43

def is_a?(check_class)
  __getobj__.class.object_id.equal?(check_class.object_id)
end

#klassObject



47
48
49
# File 'lib/snfoil/adapters/orms/base_adapter.rb', line 47

def klass
  __getobj__.class
end

#new(**_params) ⇒ Object

Raises:

  • (NotImplementedError)


23
24
25
# File 'lib/snfoil/adapters/orms/base_adapter.rb', line 23

def new(**_params)
  raise NotImplementedError, '#new not implemented in adapter'
end

#saveObject

Raises:

  • (NotImplementedError)


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

def save
  raise NotImplementedError, '#save not implemented in adapter'
end