class Twb::Action

Attributes

caption[R]
cmdExclude[R]
cmdSpecFields[R]
cmdTarget[R]
linkExpression[R]
name[R]
node[R]
sourceDash[R]
sourceSheet[R]
sourceType[R]
type[R]
uiname[R]
workbook[R]

Public Class Methods

new(actionNode, workbookNode) click to toggle source
# File lib/twb/action.rb, line 52
def initialize actionNode, workbookNode
  @workbook  = workbookNode
  @node      = actionNode
  # --
  @name      = @node.attr('name')
  @caption   = @node.attr('caption')
  @uiname    = @caption.nil? ? @name : @caption
  # --
  @type      = setType
  # --
  @cmdTarget     = cmdParam 'target'
  @cmdExclude    = cmdParam 'exclude'
  @cmdSpecFields = cmdParam 'special-fields'
  # --
  @linkExpression = linkExpr
  process
  return self
end

Public Instance Methods

cmdParam(param) click to toggle source
# File lib/twb/action.rb, line 99
def cmdParam param
  n = @node.at_xpath("./command/param[@name='#{param}']")
  return nil if n.nil?
  v = n.attribute('value')
  v.nil? ? nil : v.text
end
id() click to toggle source
# File lib/twb/action.rb, line 71
def id
    @id ||= @id = @name.hash
end
linkExpr() click to toggle source
# File lib/twb/action.rb, line 94
def linkExpr
  attr = @node.at_xpath('./link/@expression')
  attr.nil? ? nil : attr.text
end
process() click to toggle source
# File lib/twb/action.rb, line 75
def process

end
setType() click to toggle source
# File lib/twb/action.rb, line 79
def setType
  linkNode = @node.at_xpath('./link')
  return :link unless linkNode.nil?
  command  = @node.at_xpath('./command/@command')
  return :notset if command.nil?
  type = case command.text
    when 'tsc:brush'
      :highlight
    when 'tsc:tsl-filter'
      :filter
    else
      command.text
  end
end
typeConv(rawType) click to toggle source
# File lib/twb/action.rb, line 120
def typeConv rawType
end