Module: PSD::Section
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
-
#section_end ⇒ Object
readonly
Returns the value of attribute section_end.
-
#section_start ⇒ Object
readonly
Returns the value of attribute section_start.
Instance Method Summary collapse
- #end_of_section(section = :all) ⇒ Object
- #end_section(section = :all) ⇒ Object
- #start_of_section(section = :all) ⇒ Object
- #start_section(section = :all) ⇒ Object
Instance Attribute Details
#section_end ⇒ Object (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_start ⇒ Object (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 |