Method: PSD::PathRecord#initialize

Defined in:
lib/psd/path_record.rb

#initialize(file) ⇒ PathRecord

Reads the record type and begins parsing accordingly.



14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/psd/path_record.rb', line 14

def initialize(file)
  @file = file

  @record_type = @file.read_short

  case @record_type
  when 0, 3 then read_path_record
  when 1, 2, 4, 5 then read_bezier_point
  when 6 then read_path_fill_rule_record
  when 7 then read_clipboard_record
  when 8 then read_initial_fill
  else @file.seek(24, IO::SEEK_CUR)
  end
end