Module: FWToolkit::Test::FrankModel::PickleAdapter

Includes:
Pickle::Adapter::Base
Defined in:
lib/fwtoolkit/test/frank_model.rb

Class Method Summary collapse

Class Method Details

.column_names(klass) ⇒ Object

get a list of column names for a given class



70
71
72
# File 'lib/fwtoolkit/test/frank_model.rb', line 70

def self.column_names(klass)
  klass.new.methods
end

.create_model(klass, attributes) ⇒ Object

Create a model using attributes



90
91
92
# File 'lib/fwtoolkit/test/frank_model.rb', line 90

def self.create_model(klass, attributes)
  puts "create_model"
end

.find_all_models(klass, conditions) ⇒ Object

Find all models matching conditions



85
86
87
# File 'lib/fwtoolkit/test/frank_model.rb', line 85

def self.find_all_models(klass, conditions)
  FWToolkit::Test::FrankCache.find_all(klass, conditions)
end

.find_first_model(klass, conditions) ⇒ Object

Find the first instance matching conditions



80
81
82
# File 'lib/fwtoolkit/test/frank_model.rb', line 80

def self.find_first_model(klass, conditions)
  FWToolkit::Test::FrankCache.find_first(klass, conditions)
end

.get_model(klass, id) ⇒ Object

Get an instance by id of the model



75
76
77
# File 'lib/fwtoolkit/test/frank_model.rb', line 75

def self.get_model(klass, id)
  FWToolkit::Test::FrankCache.find(id)
end

.model_classes ⇒ Object

Gets a list of the available models for this adapter



65
66
67
# File 'lib/fwtoolkit/test/frank_model.rb', line 65

def self.model_classes
  klasses = ::FWToolkit::Test::FrankModel.__send__(:descendants)
end