Class: UDRS::Components::Row
- Inherits:
-
Object
- Object
- UDRS::Components::Row
- Defined in:
- lib/udrs/components/table.rb
Instance Attribute Summary collapse
-
#cells ⇒ Object
readonly
Returns the value of attribute cells.
Instance Method Summary collapse
- #cell(text, options = {}) ⇒ Object
-
#initialize(table, *args, &block) ⇒ Row
constructor
A new instance of Row.
Constructor Details
#initialize(table, *args, &block) ⇒ Row
Returns a new instance of Row.
52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/udrs/components/table.rb', line 52 def initialize(table, *args, &block) = {} = args.pop if args.last.is_a?(Hash) @cells = [] args.each { |c| cell(c, ) } block.call(self) if block if @cells.size != table.columns.size fail ArgumentError, "Row contains #{cells.size} cells, but #{table.columns.size} are required" end end |
Instance Attribute Details
#cells ⇒ Object (readonly)
Returns the value of attribute cells.
50 51 52 |
# File 'lib/udrs/components/table.rb', line 50 def cells @cells end |