class TPPlus::Nodes::HeaderNode

Public Class Methods

new(type, value) click to toggle source
# File lib/tp_plus/nodes/header_node.rb, line 4
def initialize(type, value)
  @type  = type
  @value = value
end

Public Instance Methods

eval(context, options={}) click to toggle source
# File lib/tp_plus/nodes/header_node.rb, line 9
def eval(context, options={})
  case @type
  when "TP_IGNORE_PAUSE"
    context.header_data[:ignore_pause] = @value
  when "TP_COMMENT"
    context.header_data[:comment] = @value
  when "TP_GROUPMASK"
    context.header_data[:group_mask] = @value
  when "TP_SUBTYPE"
    context.header_data[:subtype] = @value.to_sym
  else
    raise "Unsupported TP Header value (#{@type})"
  end

  nil
end