Class: Backyard::Adapter
- Inherits:
-
Object
- Object
- Backyard::Adapter
- Defined in:
- lib/backyard/adapter.rb
Direct Known Subclasses
Defined Under Namespace
Classes: FactoryGirl
Instance Method Summary collapse
- #class_for_type(model_type) ⇒ Object
- #create(model_type, attributes) ⇒ Object
- #generate_model_name(model_type) ⇒ Object
Instance Method Details
#class_for_type(model_type) ⇒ Object
4 5 6 |
# File 'lib/backyard/adapter.rb', line 4 def class_for_type(model_type) model_type.to_s.split('_').map!{ |w| w.capitalize }.join end |
#create(model_type, attributes) ⇒ Object
12 13 14 |
# File 'lib/backyard/adapter.rb', line 12 def create(model_type, attributes) raise NotImplementedError end |
#generate_model_name(model_type) ⇒ Object
8 9 10 |
# File 'lib/backyard/adapter.rb', line 8 def generate_model_name(model_type) "#{model_type.to_s.capitalize} #{Time.now.to_f}".tap{|s| s << s.object_id.to_s} end |