Class: FieldPropertyNode

Inherits:
ASTNode show all
Defined in:
lib/ast_node.rb

Constant Summary

Constants inherited from ASTNode

ASTNode::DEFAULT_GRAPH_PROPERTIES, ASTNode::METRIC_PROC_FUNCTIONS

Instance Attribute Summary collapse

Attributes inherited from ASTNode

#children, #graph_properties, #parent, #properties, #root_node

Instance Method Summary collapse

Methods inherited from ASTNode

#add_child, #children_of_class, #compile, #config=, #default_colors, #process_variables, #properties_to_url, #root?, #targets, #to_gdash, #url

Constructor Details

#initialize(line) ⇒ FieldPropertyNode

Returns a new instance of FieldPropertyNode.



255
256
257
258
259
260
261
# File 'lib/ast_node.rb', line 255

def initialize(line)
  super   
  line =~ /([\w_]+)\.(\w+)\ (.*)$/
  @metric   = $1
  @function = $2
  @value    = $3
end

Instance Attribute Details

#metricObject

Returns the value of attribute metric.



253
254
255
# File 'lib/ast_node.rb', line 253

def metric
  @metric
end

Instance Method Details

#apply_function(operand) ⇒ Object



263
264
265
# File 'lib/ast_node.rb', line 263

def apply_function(operand)
  return "FUNCION(#{operand})"
end