Class: CSVPlusPlus::Entities::Variable

Inherits:
Entity
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/csv_plus_plus/entities/variable.rb

Overview

TODO: get rid of this I think - everything will just be References

A reference to a variable

Instance Attribute Summary

Attributes inherited from Entity

#id, #type

Instance Method Summary collapse

Constructor Details

#initialize(id) ⇒ Variable

Returns a new instance of Variable.

Parameters:

  • id (Symbol)

    The identifier of the variable



14
15
16
# File 'lib/csv_plus_plus/entities/variable.rb', line 14

def initialize(id)
  super(::CSVPlusPlus::Entities::Type::Variable, id:)
end

Instance Method Details

#==(other) ⇒ boolean

Parameters:

Returns:

  • (boolean)


30
31
32
33
34
# File 'lib/csv_plus_plus/entities/variable.rb', line 30

def ==(other)
  return false unless super

  other.is_a?(self.class) && @id == other.id
end

#evaluate(_runtime) ⇒ ::String

Parameters:

Returns:

  • (::String)


22
23
24
# File 'lib/csv_plus_plus/entities/variable.rb', line 22

def evaluate(_runtime)
  "$$#{@id}"
end