Module: DocxReport::DataItem
Instance Attribute Summary collapse
-
#fields ⇒ Object
readonly
Returns the value of attribute fields.
-
#images ⇒ Object
readonly
Returns the value of attribute images.
-
#tables ⇒ Object
readonly
Returns the value of attribute tables.
Instance Method Summary collapse
Instance Attribute Details
#fields ⇒ Object (readonly)
Returns the value of attribute fields.
3 4 5 |
# File 'lib/docx_report/data_item.rb', line 3 def fields @fields end |
#images ⇒ Object (readonly)
Returns the value of attribute images.
3 4 5 |
# File 'lib/docx_report/data_item.rb', line 3 def images @images end |
#tables ⇒ Object (readonly)
Returns the value of attribute tables.
3 4 5 |
# File 'lib/docx_report/data_item.rb', line 3 def tables @tables end |
Instance Method Details
#add_field(name, value, type = :text, text_direction = :none) ⇒ Object
5 6 7 8 9 |
# 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 |