Class: Symbol

Inherits:
Object show all
Defined in:
lib/porolog/core_ext.rb

Overview

In Porolog, Symbols represent Variables.

Instance Method Summary collapse

Instance Method Details

#/(other) ⇒ Array

Returns an Array with the Object being the head and the other Object being the tail.

Parameters:

  • other (Object) —

    the Object which is to be the tail

Returns:

  • (Array) —

    an Array with the Object being the head and the other Object being the tail.



76
77
78
# File 'lib/porolog/core_ext.rb', line 76

def /(other)
  [self]/other
end

#myid ⇒ String

A convenience method for testing/debugging.

Returns:

  • (String) —

    the equivalent of inspect.



60
61
62
# File 'lib/porolog/core_ext.rb', line 60

def myid
  inspect
end

#type ⇒ Symbol

Returns the type of the object (for a Symbol, should be :variable).

Returns:

  • (Symbol) —

    the type of the object (for a Symbol, should be :variable)



70
71
72
# File 'lib/porolog/core_ext.rb', line 70

def type
  :variable
end

#variables ⇒ Array

Returns embedded variables (for a Symbol, should be itself).

Returns:

  • (Array) —

    embedded variables (for a Symbol, should be itself).



65
66
67
# File 'lib/porolog/core_ext.rb', line 65

def variables
  [self]
end