Class: PSD::UnicodeName

Inherits:
LayerInfo show all
Defined in:
lib/psd/layer/info/unicode_name.rb

Instance Attribute Summary

Attributes inherited from LayerInfo

#data

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from LayerInfo

#initialize, #skip

Constructor Details

This class inherits a constructor from PSD::LayerInfo

Class Method Details

.should_parse?(key) ⇒ Boolean

Returns:

  • (Boolean)


5
6
7
# File 'lib/psd/layer/info/unicode_name.rb', line 5

def self.should_parse?(key)
  key == 'luni'
end

Instance Method Details

#parseObject



9
10
11
12
13
14
15
16
17
# File 'lib/psd/layer/info/unicode_name.rb', line 9

def parse
  pos = @file.tell
  @data = @file.read_unicode_string

  # The name seems to be padded with null bytes. This is the easiest solution.
  @file.seek pos + @length

  return self
end