Class: Rubylog::DSL::ArraySplat
- 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
-
#var ⇒ Object
readonly
Returns the value of attribute var.
Attributes included from CompoundTerm
Instance Method Summary collapse
- #==(other) ⇒ Object
- #eql?(other) ⇒ Boolean
-
#initialize(var = Rubylog::Variable.new) ⇒ ArraySplat
constructor
A new instance of ArraySplat.
- #inspect ⇒ Object
- #rubylog_clone(&block) ⇒ Object
- #rubylog_deep_dereference ⇒ Object
Methods included from CompoundTerm
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
#var ⇒ Object (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
15 16 17 |
# File 'lib/rubylog/dsl/array_splat.rb', line 15 def eql? other self.class == other.class && @var.eql?(other.var) end |
#inspect ⇒ Object
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_dereference ⇒ Object
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 |