Class: EleetScript::EleetScriptClassSkeleton

Inherits:
Object
  • Object
show all
Defined in:
lib/lang/runtime/class_skeleton.rb

Direct Known Subclasses

EleetScriptClass, EleetScriptClassInstance

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#memoryObject (readonly)

Returns the value of attribute memory.



6
7
8
# File 'lib/lang/runtime/class_skeleton.rb', line 6

def memory
  @memory
end

#ruby_valueObject

Returns the value of attribute ruby_value.



5
6
7
# File 'lib/lang/runtime/class_skeleton.rb', line 5

def ruby_value
  @ruby_value
end

Class Method Details

.set_is_classObject



17
18
19
20
21
22
23
# File 'lib/lang/runtime/class_skeleton.rb', line 17

def set_is_class
  self.class_eval do
    def class?
      true
    end
  end
end

.set_is_instanceObject



9
10
11
12
13
14
15
# File 'lib/lang/runtime/class_skeleton.rb', line 9

def set_is_instance
  self.class_eval do
    def instance?
      true
    end
  end
end

Instance Method Details

#class?Boolean



30
31
32
# File 'lib/lang/runtime/class_skeleton.rb', line 30

def class?
  false
end

#eql?(other) ⇒ Boolean



46
47
48
49
50
51
52
53
54
55
# File 'lib/lang/runtime/class_skeleton.rb', line 46

def eql?(other)
  if other.kind_of?(EleetScriptClassSkeleton)
    if instance?
      return call(:is, [other]).ruby_value
    elsif class? && other.class?
      return name == other.name
    end
  end
  false
end

#hashObject



38
39
40
41
42
43
44
# File 'lib/lang/runtime/class_skeleton.rb', line 38

def hash
  if instance?
    ruby_value.hash
  else
    name.hash
  end
end

#instance?Boolean



26
27
28
# File 'lib/lang/runtime/class_skeleton.rb', line 26

def instance?
  false
end

#is_a?(*names) ⇒ Boolean



34
35
36
# File 'lib/lang/runtime/class_skeleton.rb', line 34

def is_a?(*names)
  false
end