Class: QVal

Inherits:
Object
  • Object
show all
Defined in:
lib/qtypes.rb

Overview

parent class for all the quark primitive values

Direct Known Subclasses

QAtom, QNum, QStr, QSym

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(v) ⇒ QVal

Returns a new instance of QVal.



9
10
11
# File 'lib/qtypes.rb', line 9

def initialize(v)
  @val = v
end

Instance Attribute Details

#valObject

Returns the value of attribute val.



7
8
9
# File 'lib/qtypes.rb', line 7

def val
  @val
end

Instance Method Details

#==(a) ⇒ Object



17
18
19
20
# File 'lib/qtypes.rb', line 17

def ==(a)
  return @val == a.val if a.is_a? self.class
  false
end

#to_sObject



13
14
15
# File 'lib/qtypes.rb', line 13

def to_s
  @val.to_s
end