Module: PSD::Section

Included in:
Layer, LayerMask, Resources
Defined in:
lib/psd/section.rb

Overview

Helper that lets us track the beginning and ending locations of each section. This is for debug and error catching purposes, primarily.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#section_endObject (readonly)

Returns the value of attribute section_end.



6
7
8
# File 'lib/psd/section.rb', line 6

def section_end
  @section_end
end

#section_startObject (readonly)

Returns the value of attribute section_start.



6
7
8
# File 'lib/psd/section.rb', line 6

def section_start
  @section_start
end

Instance Method Details

#end_of_section(section = :all) ⇒ Object



22
23
24
# File 'lib/psd/section.rb', line 22

def end_of_section(section=:all)
  @section_end[section]
end

#end_section(section = :all) ⇒ Object



13
14
15
16
# File 'lib/psd/section.rb', line 13

def end_section(section=:all)
  @section_end = {} unless @section_end
  @section_end[section] = @file.tell
end

#start_of_section(section = :all) ⇒ Object



18
19
20
# File 'lib/psd/section.rb', line 18

def start_of_section(section=:all)
  @section_start[section]
end

#start_section(section = :all) ⇒ Object



8
9
10
11
# File 'lib/psd/section.rb', line 8

def start_section(section=:all)
  @section_start = {} unless @section_start
  @section_start[section] = @file.tell
end