Class: TypeProf::Core::ValueEntity

Inherits:
Object
  • Object
show all
Defined in:
lib/typeprof/core/env/value_entity.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeValueEntity

Returns a new instance of ValueEntity.



3
4
5
6
7
8
# File 'lib/typeprof/core/env/value_entity.rb', line 3

def initialize
  @decls = Set[]
  @defs = Set[]
  @read_boxes = Set[]
  @vtx = Vertex.new(self)
end

Instance Attribute Details

#declsObject (readonly)

Returns the value of attribute decls.



10
11
12
# File 'lib/typeprof/core/env/value_entity.rb', line 10

def decls
  @decls
end

#defsObject (readonly)

Returns the value of attribute defs.



10
11
12
# File 'lib/typeprof/core/env/value_entity.rb', line 10

def defs
  @defs
end

#read_boxesObject (readonly)

Returns the value of attribute read_boxes.



10
11
12
# File 'lib/typeprof/core/env/value_entity.rb', line 10

def read_boxes
  @read_boxes
end

#vtxObject (readonly)

Returns the value of attribute vtx.



10
11
12
# File 'lib/typeprof/core/env/value_entity.rb', line 10

def vtx
  @vtx
end

Instance Method Details

#add_decl(decl) ⇒ Object



12
13
14
# File 'lib/typeprof/core/env/value_entity.rb', line 12

def add_decl(decl)
  @decls << decl
end

#add_def(def_) ⇒ Object



20
21
22
# File 'lib/typeprof/core/env/value_entity.rb', line 20

def add_def(def_)
  @defs << def_
end

#exist?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/typeprof/core/env/value_entity.rb', line 28

def exist?
  !@decls.empty? || !@defs.empty?
end

#remove_decl(decl) ⇒ Object



16
17
18
# File 'lib/typeprof/core/env/value_entity.rb', line 16

def remove_decl(decl)
  @decls.delete(decl) || raise
end

#remove_def(def_) ⇒ Object



24
25
26
# File 'lib/typeprof/core/env/value_entity.rb', line 24

def remove_def(def_)
  @defs.delete(def_) || raise
end