Class: Rubylog::DSL::ArraySplat

Inherits:
Object
  • Object
show all
Includes:
CompoundTerm
Defined in:
lib/rubylog/dsl/array_splat.rb

Overview

this class is used as a placeholder for array splats.

*A

> [ArraySplat.new(A)]

Instance Attribute Summary collapse

Attributes included from CompoundTerm

#rubylog_variables

Instance Method Summary collapse

Methods included from CompoundTerm

#rubylog_match_variables

Constructor Details

#initialize(var = Rubylog::Variable.new) ⇒ ArraySplat

Returns a new instance of ArraySplat.



7
8
9
# File 'lib/rubylog/dsl/array_splat.rb', line 7

def initialize var = Rubylog::Variable.new
  @var = var
end

Instance Attribute Details

#varObject (readonly)

Returns the value of attribute var.



5
6
7
# File 'lib/rubylog/dsl/array_splat.rb', line 5

def var
  @var
end

Instance Method Details

#==(other) ⇒ Object



19
20
21
# File 'lib/rubylog/dsl/array_splat.rb', line 19

def == other
  self.class == other.class && @var == other.var
end

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/rubylog/dsl/array_splat.rb', line 15

def eql? other
  self.class == other.class && @var.eql?(other.var)
end

#inspectObject



11
12
13
# File 'lib/rubylog/dsl/array_splat.rb', line 11

def inspect
  "*#{var.inspect}"
end

#rubylog_clone(&block) ⇒ Object



26
27
28
# File 'lib/rubylog/dsl/array_splat.rb', line 26

def rubylog_clone &block
  block[Rubylog::DSL::ArraySplat.new(@var.rubylog_clone(&block))]
end

#rubylog_deep_dereferenceObject



30
31
32
# File 'lib/rubylog/dsl/array_splat.rb', line 30

def rubylog_deep_dereference
  Rubylog::DSL::ArraySplat.new(@var.rubylog_deep_dereference)
end