Module: Resilience::OnImage

Included in:
Attribute, BootTable, FSDir::DirBase, FSDir::Record, ObjectTable, ObjectTree, Page, RootDir, SystemTable
Defined in:
lib/resilience/mixins/on_image.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.imageObject



11
12
13
# File 'lib/resilience/mixins/on_image.rb', line 11

def self.image
  @image ||= Resilience::Image.new
end

.included(base) ⇒ Object



7
8
9
# File 'lib/resilience/mixins/on_image.rb', line 7

def self.included(base)
  base.extend(ClassMethods)
end

.restore_posObject



20
21
22
# File 'lib/resilience/mixins/on_image.rb', line 20

def self.restore_pos
  image.seek @image_pos.shift
end

.store_posObject



15
16
17
18
# File 'lib/resilience/mixins/on_image.rb', line 15

def self.store_pos
  @image_pos ||= []
  @image_pos.unshift image.pos
end

Instance Method Details

#imageObject



24
25
26
# File 'lib/resilience/mixins/on_image.rb', line 24

def image
  OnImage.image
end

#restore_posObject



32
33
34
# File 'lib/resilience/mixins/on_image.rb', line 32

def restore_pos
  OnImage.restore_pos
end

#store_posObject



28
29
30
# File 'lib/resilience/mixins/on_image.rb', line 28

def store_pos
  OnImage.store_pos
end