Class: CSVPlusPlus::Language::Entities::Variable

Inherits:
Entity
  • Object
show all
Defined in:
lib/csv_plus_plus/language/entities/variable.rb

Overview

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

initialize



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

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

Dynamic Method Handling

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

Instance Method Details

#==(other) ⇒ Object



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

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

#to_sObject

to_s



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

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