Class: Twb::WorksheetField

Inherits:
Object
  • Object
show all
Defined in:
lib/twb/worksheet.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(node, dsName) ⇒ WorksheetField


261
262
263
264
265
266
267
# File 'lib/twb/worksheet.rb', line 261

def initialize node, dsName
  @node    = node
  @name    = node.attr('name').gsub(/^\[/,'').gsub(/\]$/,'')
  @caption = node.attr('caption').nil? ? nil : node.attr('caption').gsub(/^\[/,'').gsub(/\]$/,'') 
  @uiname  = if @caption.nil? || @caption == '' then @name else @caption end
  @datasource = dsName
end

Instance Attribute Details

#captionObject (readonly)


259
260
261
# File 'lib/twb/worksheet.rb', line 259

def caption
  @caption
end

#datasourceObject (readonly)


259
260
261
# File 'lib/twb/worksheet.rb', line 259

def datasource
  @datasource
end

#nameObject (readonly)


259
260
261
# File 'lib/twb/worksheet.rb', line 259

def name
  @name
end

#nodeObject (readonly)


259
260
261
# File 'lib/twb/worksheet.rb', line 259

def node
  @node
end

#uinameObject (readonly)


259
260
261
# File 'lib/twb/worksheet.rb', line 259

def uiname
  @uiname
end

Instance Method Details

#to_sObject


269
270
271
# File 'lib/twb/worksheet.rb', line 269

def to_s
  "name:#{@name}|caption:#{@caption}|uiname:#{@uiname}||ds:#{datasource}"
end