Class: Object
- Inherits:
- BasicObject
- Defined in:
- lib/porolog/core_ext.rb
Overview
In Porolog, Objects represent atomic values.
Instance Method Summary collapse
-
#headtail? ⇒ Boolean
Whether the Object is an Array with a head and a tail (for an Object, should be false).
-
#myid ⇒ String
A convenience method for testing/debugging.
-
#tail(other) ⇒ Array
(also: #/)
An Array with the Object being the head and the other Object being the tail.
-
#type ⇒ Symbol
The type of the object (for an Object, should be :atomic).
-
#value ⇒ Object
The value of the object, which is itself.
-
#variables ⇒ Array
Embedded variables (for an Object, should be none).
Instance Method Details
#headtail? ⇒ Boolean
Returns whether the Object is an Array with a head and a tail (for an Object, should be false).
48 49 50 |
# File 'lib/porolog/core_ext.rb', line 48 def headtail? false end |
#myid ⇒ String
A convenience method for testing/debugging.
16 17 18 |
# File 'lib/porolog/core_ext.rb', line 16 def myid inspect end |
#tail(other) ⇒ Array Also known as: /
Returns an Array with the Object being the head and the other Object being the tail.
40 41 42 |
# File 'lib/porolog/core_ext.rb', line 40 def tail(other) [self]/other end |
#type ⇒ Symbol
Returns the type of the object (for an Object, should be :atomic)
26 27 28 |
# File 'lib/porolog/core_ext.rb', line 26 def type :atomic end |
#value ⇒ Object
Returns the value of the object, which is itself.
31 32 33 |
# File 'lib/porolog/core_ext.rb', line 31 def value(*) self end |
#variables ⇒ Array
Returns embedded variables (for an Object, should be none).
21 22 23 |
# File 'lib/porolog/core_ext.rb', line 21 def variables [] end |