class DocxReport::Field

Attributes

name[R]
text_direction[R]
type[R]
value[R]

Public Class Methods

new(name, value = nil, type = :text, text_direction = :none, &block) click to toggle source
# File lib/docx_report/field.rb, line 9
def initialize(name, value = nil, type = :text, text_direction = :none,
               &block)
  @name = "@#{name}@"
  @type = type
  @text_direction = text_direction
  set_value(value || block)
end

Public Instance Methods

load_field(item) click to toggle source
# File lib/docx_report/field.rb, line 21
def load_field(item)
  Field.new(name[1..-2], load_value(item), type, load_text_direction(item))
end
set_value(value = nil, &block) click to toggle source
# File lib/docx_report/field.rb, line 17
def set_value(value = nil, &block)
  @value = value || block
end