Class: TPPlus::Nodes::HeaderNode
- Inherits:
-
Object
- Object
- TPPlus::Nodes::HeaderNode
- Defined in:
- lib/tp_plus/nodes/header_node.rb
Instance Method Summary collapse
- #eval(context, options = {}) ⇒ Object
-
#initialize(type, value) ⇒ HeaderNode
constructor
A new instance of HeaderNode.
Constructor Details
#initialize(type, value) ⇒ HeaderNode
Returns a new instance of HeaderNode.
4 5 6 7 |
# File 'lib/tp_plus/nodes/header_node.rb', line 4 def initialize(type, value) @type = type @value = value end |
Instance Method Details
#eval(context, options = {}) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/tp_plus/nodes/header_node.rb', line 9 def eval(context, ={}) 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 |