Method: Writexlsx::Shape#validate
- Defined in:
- lib/write_xlsx/shape.rb
#validate(index) ⇒ Object
Check shape attributes to ensure they are valid.
285 286 287 288 289 |
# File 'lib/write_xlsx/shape.rb', line 285 def validate(index) raise "Shape #{index} (#{@type}) alignment (#{@align}) not in ['l', 'ctr', 'r', 'just']\n" unless %w[l ctr r just].include?(@align) raise "Shape #{index} (#{@type}) vertical alignment (#{@valign}) not in ['t', 'ctr', 'v']\n" unless %w[t ctr b].include?(@valign) end |