class Variable

Base variable, each variable has a type and a name at the very least.

Public Instance Methods

name() click to toggle source

Returns the name of the variable

@return [String] the variable name

# File lib/steamd/nodes/variable_node.rb, line 7
def name
  variable_name.text_value
end
size() click to toggle source

Returns the size, if any of the variable. ie byte<6> y;

@return [String/Integer/nil] the variable size

# File lib/steamd/nodes/variable_node.rb, line 21
def size
  return nil unless var_type && var_type.respond_to?(:size)

  if var_type.size.text_value.empty?
    nil
  else
    var_type.size.var_value.value
  end
end
to_hash() click to toggle source

Hash representation of this Variable Node

@return [Hash]

# File lib/steamd/nodes/variable_node.rb, line 34
def to_hash
  {
    name: name,
    type: type,
    modifier: nil,
    value: nil,
    size: size,
    modifier_size: nil
  }
end
type() click to toggle source

Returns the type of the variable

@return [String] the variable type

# File lib/steamd/nodes/variable_node.rb, line 14
def type
  var_type.type.text_value
end