Class: Whiteprint::Adapters::Test

Inherits:
Base
  • Object
show all
Defined in:
lib/whiteprint/adapters/test.rb

Instance Attribute Summary

Attributes inherited from Base

#attributes, #configs, #model, #options

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#changes?, #changes_tree, #clone_to, #execute, #explanation, #initialize, load_plugins, #method_missing, #set_model, #table_exists?, #table_name, #transformer

Constructor Details

This class inherits a constructor from Whiteprint::Base

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Whiteprint::Base

Class Method Details

.applicable?(_model) ⇒ Boolean



5
6
7
# File 'lib/whiteprint/adapters/test.rb', line 5

def applicable?(_model)
  false
end

Instance Method Details

#persisted(&block) ⇒ Object



14
15
16
17
# File 'lib/whiteprint/adapters/test.rb', line 14

def persisted(&block)
  @_persisted_whiteprint ||= Whiteprint::Base.new(@model)
  @_persisted_whiteprint.instance_eval(&block)
end

#persisted_attributesObject



10
11
12
# File 'lib/whiteprint/adapters/test.rb', line 10

def persisted_attributes
  @_persisted_whiteprint.attributes
end