class Porolog::Tail

A Porolog::Tail is used to represent the tail of a list.

It corresponds to the use of the splat operator within an Array.

@author Luis Esteban

@!attribute value

@return [Object] The value of the tail.

Public Class Methods

new(value = UNKNOWN_TAIL) click to toggle source

Creates a new Tail for an Array. @param value [Object] the value of the tail.

# File lib/porolog/tail.rb, line 22
def initialize(value = UNKNOWN_TAIL)
  @value = value
end

Public Instance Methods

==(other) click to toggle source

@param other [Object, value] @return [Boolean] whether the value of the Tail is equal to the value of another Object.

# File lib/porolog/tail.rb, line 51
def ==(other)
  @value == other.value
end
inspect() click to toggle source

@return [String] pretty representation.

# File lib/porolog/tail.rb, line 40
def inspect
  "*#{@value.inspect}"
end
type() click to toggle source

@return [Symbol] the type of the Tail, which should be :tail.

# File lib/porolog/tail.rb, line 27
def type
  :tail
end
value(*) click to toggle source

Returns the value of the Tail. The optional arguments are ignored; this is for polymorphic compatibility with Porolog::Value and Porolog::Variable, which are used to prevent inifinite recursion. @return [Object] the value of the Tail.

# File lib/porolog/tail.rb, line 35
def value(*)
  @value
end
variables() click to toggle source

@return [Array] embedded variables.

# File lib/porolog/tail.rb, line 45
def variables
  @value.variables
end