module DocxReport::DataItem

Attributes

fields[R]
images[R]
tables[R]

Public Instance Methods

add_field(name, value, type = :text, text_direction = :none) click to toggle source
# File lib/docx_report/data_item.rb, line 5
def add_field(name, value, type = :text, text_direction = :none)
  field = Field.new name, value, type, text_direction
  raise 'duplicate field name' if @fields.any? { |f| f.name == field.name }
  @fields << field
end