Class: Tzispa::Annotation

Inherits:
Object
  • Object
show all
Defined in:
lib/tzispa/annotations/annotation.rb

Constant Summary collapse

@@annmutext =
Mutex.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#contextObject

Returns the value of attribute context.



3
4
5
# File 'lib/tzispa/annotations/annotation.rb', line 3

def context
  @context
end

Class Method Details

.+@Object



22
23
24
# File 'lib/tzispa/annotations/annotation.rb', line 22

def +@
  +new
end

.annotationsObject

rubocop:disable Style/ClassVars



15
16
17
18
19
20
# File 'lib/tzispa/annotations/annotation.rb', line 15

def annotations
  return __annotations_container if @@annmutext.locked?
  synchronize do
    __annotations_container
  end
end

.current_annotationsObject



26
27
28
# File 'lib/tzispa/annotations/annotation.rb', line 26

def current_annotations
  annotations.pop annotations.size
end

.synchronizeObject



30
31
32
# File 'lib/tzispa/annotations/annotation.rb', line 30

def synchronize
  @@annmutext.synchronize { yield }
end

Instance Method Details

#+@Object



7
8
9
10
11
# File 'lib/tzispa/annotations/annotation.rb', line 7

def +@
  self.class.synchronize do
    self.class.annotations << self
  end
end