Class: CSVPlusPlus::Entities::EntityWithArguments

Inherits:
Entity
  • Object
show all
Extended by:
T::Generic, T::Helpers, T::Sig
Defined in:
lib/csv_plus_plus/entities/entity_with_arguments.rb

Overview

An entity that can take other entities as arguments. Current use cases for this are function calls and function definitions

Direct Known Subclasses

Function, FunctionCall

Constant Summary collapse

ArgumentsType =
type_member

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Entity

#evaluate

Constructor Details

#initialize(arguments: []) ⇒ EntityWithArguments

Returns a new instance of EntityWithArguments.

Parameters:



25
26
27
28
# File 'lib/csv_plus_plus/entities/entity_with_arguments.rb', line 25

def initialize(arguments: [])
  super()
  @arguments = arguments
end

Instance Attribute Details

#argumentsArray<Entity> (readonly)

The arguments supplied to this entity.

Returns:

  • (Array<Entity>)

    the current value of arguments



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

def arguments
  @arguments
end

Instance Method Details

#==(other) ⇒ boolean

Parameters:

Returns:

  • (boolean)


34
35
36
37
38
39
40
41
# File 'lib/csv_plus_plus/entities/entity_with_arguments.rb', line 34

def ==(other)
  case other
  when self.class
    @arguments == other.arguments
  else
    false
  end
end