Class: PSD::NestedLayerDivider
- Defined in:
- lib/psd/layer/info/layer_group.rb
Overview
Not 100% sure what the purpose of this key is, but it seems to exist whenever the lsct key doesn’t. Parsing this like a layer section divider seems to solve a lot of parsing issues with folders.
Instance Attribute Summary collapse
-
#is_folder ⇒ Object
readonly
Returns the value of attribute is_folder.
-
#is_hidden ⇒ Object
readonly
Returns the value of attribute is_hidden.
Attributes inherited from LayerInfo
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(file, length) ⇒ NestedLayerDivider
constructor
A new instance of NestedLayerDivider.
- #parse ⇒ Object
Methods inherited from LayerInfo
Constructor Details
#initialize(file, length) ⇒ NestedLayerDivider
Returns a new instance of NestedLayerDivider.
16 17 18 19 20 21 |
# File 'lib/psd/layer/info/layer_group.rb', line 16 def initialize(file, length) super @is_folder = false @is_hidden = false end |
Instance Attribute Details
#is_folder ⇒ Object (readonly)
Returns the value of attribute is_folder.
14 15 16 |
# File 'lib/psd/layer/info/layer_group.rb', line 14 def is_folder @is_folder end |
#is_hidden ⇒ Object (readonly)
Returns the value of attribute is_hidden.
14 15 16 |
# File 'lib/psd/layer/info/layer_group.rb', line 14 def is_hidden @is_hidden end |
Class Method Details
.should_parse?(key) ⇒ Boolean
10 11 12 |
# File 'lib/psd/layer/info/layer_group.rb', line 10 def self.should_parse?(key) key == 'lsdk' end |
Instance Method Details
#parse ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'lib/psd/layer/info/layer_group.rb', line 23 def parse code = @file.read_int case code when 1, 2 then @is_folder = true when 3 then @is_hidden = true end end |