Class: Twb::TabClass

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

Constant Summary collapse

@@ttlogfilename =
'TableauTools.ttlog'
@@ttdocdir =
'./ttdoc'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeTabClass

Returns a new instance of TabClass.



28
29
30
31
32
# File 'lib/twb/tabclass.rb', line 28

def initialize
    @ttlogfile    = 'TableauTools.ttlog'
    @logger       = Logger.new(@ttlogfile)
    @logger.level = Logger::DEBUG
end

Instance Attribute Details

#idObject

Returns the value of attribute id.



22
23
24
# File 'lib/twb/tabclass.rb', line 22

def id
  @id
end

#propertiesObject

Returns the value of attribute properties.



22
23
24
# File 'lib/twb/tabclass.rb', line 22

def properties
  @properties
end

#ttlogfileObject

Returns the value of attribute ttlogfile.



22
23
24
# File 'lib/twb/tabclass.rb', line 22

def ttlogfile
  @ttlogfile
end

#ttlogfilenameObject

Returns the value of attribute ttlogfilename.



22
23
24
# File 'lib/twb/tabclass.rb', line 22

def ttlogfilename
  @ttlogfilename
end

#typeObject

Returns the value of attribute type.



22
23
24
# File 'lib/twb/tabclass.rb', line 22

def type
  @type
end

#uuidObject

Returns the value of attribute uuid.



22
23
24
# File 'lib/twb/tabclass.rb', line 22

def uuid
  @uuid
end

Instance Method Details

#docFile(name) ⇒ Object



50
51
52
# File 'lib/twb/tabclass.rb', line 50

def docFile name
  @ttdocdir.nil? ? name : "#{@@ttdocdir}/#{name}"
end

#emit(local = @localEmit, stuff) ⇒ Object



54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/twb/tabclass.rb', line 54

def emit(local=@localEmit, stuff)
    # puts "\nstuff.class #{stuff.class}  :: #{stuff}" if local
    if stuff.is_a? String then
      lines = stuff.split(/\n/)
      lines.each do |line|
        @logger.debug "#{@emitPrefix}#{line}"
                 puts "#{@emitPrefix}#{line}" if local
      end
    else
        @logger.debug "#{@emitPrefix}#{stuff}"
                 puts "#{@emitPrefix}#{stuff}" if local
    end
end

#setDocFileNameObject



46
47
48
# File 'lib/twb/tabclass.rb', line 46

def setDocFileName
    docFile @@ttlogfilename
end