Class: Cranium::TestFramework::DatabaseEntity
- Inherits:
-
Object
- Object
- Cranium::TestFramework::DatabaseEntity
- Defined in:
- lib/cranium/test_framework/database_entity.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#connection ⇒ Object
readonly
Returns the value of attribute connection.
-
#entity_name ⇒ Object
readonly
Returns the value of attribute entity_name.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(entity, db_connection) ⇒ DatabaseEntity
constructor
A new instance of DatabaseEntity.
Constructor Details
#initialize(entity, db_connection) ⇒ DatabaseEntity
Returns a new instance of DatabaseEntity.
8 9 10 |
# File 'lib/cranium/test_framework/database_entity.rb', line 8 def initialize(entity, db_connection) @entity_name, @connection = entity, db_connection end |
Instance Attribute Details
#connection ⇒ Object (readonly)
Returns the value of attribute connection.
4 5 6 |
# File 'lib/cranium/test_framework/database_entity.rb', line 4 def connection @connection end |
#entity_name ⇒ Object (readonly)
Returns the value of attribute entity_name.
3 4 5 |
# File 'lib/cranium/test_framework/database_entity.rb', line 3 def entity_name @entity_name end |
Class Method Details
.cleanup ⇒ Object
22 23 24 25 |
# File 'lib/cranium/test_framework/database_entity.rb', line 22 def cleanup entities_created.each { |entity| entity.destroy } @entities_created = [] end |
.entities_created ⇒ Object
16 17 18 |
# File 'lib/cranium/test_framework/database_entity.rb', line 16 def entities_created @entities_created ||= [] end |