Class: Mortadella::Vertical
- Inherits:
-
Object
- Object
- Mortadella::Vertical
- Defined in:
- lib/mortadella/vertical.rb
Overview
Makes it easy to build DRY horizontal Cucumber-compatible tables
Instance Attribute Summary collapse
-
#table ⇒ Object
readonly
Returns the value of attribute table.
Instance Method Summary collapse
-
#[]=(header, row) ⇒ Object
Adds the given row to the table.
- #empty? ⇒ Boolean
-
#initialize ⇒ Vertical
constructor
A new instance of Vertical.
Constructor Details
#initialize ⇒ Vertical
Returns a new instance of Vertical.
9 10 11 |
# File 'lib/mortadella/vertical.rb', line 9 def initialize @table = [] end |
Instance Attribute Details
#table ⇒ Object (readonly)
Returns the value of attribute table.
6 7 8 |
# File 'lib/mortadella/vertical.rb', line 6 def table @table end |
Instance Method Details
#[]=(header, row) ⇒ Object
Adds the given row to the table
15 16 17 |
# File 'lib/mortadella/vertical.rb', line 15 def []= header, row @table << [header, row] end |
#empty? ⇒ Boolean
20 21 22 |
# File 'lib/mortadella/vertical.rb', line 20 def empty? @table.size == 1 end |