Class: MiniKraken::Atomic::KSymbol

Inherits:
AtomicTerm show all
Defined in:
lib/mini_kraken/atomic/k_symbol.rb

Overview

A specialized atomic term that represents a symbolic value in MiniKraken.

Instance Attribute Summary

Attributes inherited from AtomicTerm

#value

Instance Method Summary collapse

Methods inherited from AtomicTerm

#==, #dependencies, #dup_cond, #eql?, #floating?, #initialize, #pinned?, #quote, #unbound?

Methods inherited from Core::Term

#dup_cond

Constructor Details

This class inherits a constructor from MiniKraken::Atomic::AtomicTerm

Instance Method Details

#id2nameString

Returns the name or string corresponding to value.

Returns:

  • (String)


12
13
14
# File 'lib/mini_kraken/atomic/k_symbol.rb', line 12

def id2name
  value.id2name
end

#to_sString

Returns a string representing the MiniKraken symbol.

Returns:

  • (String)


18
19
20
# File 'lib/mini_kraken/atomic/k_symbol.rb', line 18

def to_s
  ":#{id2name}"
end