Class: CSVPlusPlus::Entities::Variable

Inherits:
Entity
  • Object
show all
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

Methods inherited from Entity

#method_missing, #respond_to_missing?

Constructor Details

#initialize(id) ⇒ Variable

Returns a new instance of Variable.

Parameters:

  • id (Symbol)

    The identifier of the variable



10
11
12
# File 'lib/csv_plus_plus/entities/variable.rb', line 10

def initialize(id)
  super(:variable, id:)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class CSVPlusPlus::Entities::Entity

Instance Method Details

#==(other) ⇒ boolean

Returns:

  • (boolean)


20
21
22
# File 'lib/csv_plus_plus/entities/variable.rb', line 20

def ==(other)
  super && id == other.id
end

#to_sString

Returns:



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

def to_s
  "$$#{@id}"
end