Class: Latex::RowFamily
- Inherits:
-
Object
- Object
- Latex::RowFamily
- Defined in:
- lib/ruby-latex.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#columns ⇒ Object
readonly
Returns the value of attribute columns.
-
#rows ⇒ Object
readonly
Returns the value of attribute rows.
Instance Method Summary collapse
- #<<(row) ⇒ Object
- #format(element, col) ⇒ Object
- #formatter=(formatter) ⇒ Object
-
#initialize(columns) ⇒ RowFamily
constructor
A new instance of RowFamily.
- #style(element) ⇒ Object
- #styler=(styler) ⇒ Object
Constructor Details
#initialize(columns) ⇒ RowFamily
Returns a new instance of RowFamily.
146 147 148 149 150 151 |
# File 'lib/ruby-latex.rb', line 146 def initialize(columns) @columns = columns @rows = [] @styler = proc { |e| e } end |
Instance Attribute Details
#columns ⇒ Object (readonly)
Returns the value of attribute columns.
144 145 146 |
# File 'lib/ruby-latex.rb', line 144 def columns @columns end |
#rows ⇒ Object (readonly)
Returns the value of attribute rows.
143 144 145 |
# File 'lib/ruby-latex.rb', line 143 def rows @rows end |
Instance Method Details
#<<(row) ⇒ Object
165 166 167 168 169 |
# File 'lib/ruby-latex.rb', line 165 def <<(row) row.family = self @rows << row end |
#format(element, col) ⇒ Object
157 158 159 |
# File 'lib/ruby-latex.rb', line 157 def format(element, col) @columns[col].formatter.call(element) end |
#formatter=(formatter) ⇒ Object
171 172 173 |
# File 'lib/ruby-latex.rb', line 171 def formatter=(formatter) @formatter = formatter end |
#style(element) ⇒ Object
161 162 163 |
# File 'lib/ruby-latex.rb', line 161 def style(element) @styler.call(element) end |
#styler=(styler) ⇒ Object
175 176 177 |
# File 'lib/ruby-latex.rb', line 175 def styler=(styler) @styler = styler end |