Class: Simmer::Database::Fixture
- Inherits:
-
Object
- Object
- Simmer::Database::Fixture
- Defined in:
- lib/simmer/database/fixture.rb
Overview
A fixture is a database record that can be inserted in the Stage phase of a specification execution.
Instance Attribute Summary collapse
-
#fields ⇒ Object
readonly
Returns the value of attribute fields.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#table ⇒ Object
readonly
Returns the value of attribute table.
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
-
#initialize(fields: {}, name:, table:) ⇒ Fixture
constructor
A new instance of Fixture.
Constructor Details
#initialize(fields: {}, name:, table:) ⇒ Fixture
Returns a new instance of Fixture.
21 22 23 24 25 |
# File 'lib/simmer/database/fixture.rb', line 21 def initialize(fields: {}, name:, table:) @fields = fields || {} @name = name.to_s @table = table.to_s end |
Instance Attribute Details
#fields ⇒ Object (readonly)
Returns the value of attribute fields.
17 18 19 |
# File 'lib/simmer/database/fixture.rb', line 17 def fields @fields end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
17 18 19 |
# File 'lib/simmer/database/fixture.rb', line 17 def name @name end |
#table ⇒ Object (readonly)
Returns the value of attribute table.
17 18 19 |
# File 'lib/simmer/database/fixture.rb', line 17 def table @table end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
27 28 29 30 31 32 |
# File 'lib/simmer/database/fixture.rb', line 27 def ==(other) other.instance_of?(self.class) && fields == other.fields && name == other.name && table == other.table end |