Class: PSD::Resource::Section::Slices
- Defined in:
- lib/psd/resources/slices.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
Methods inherited from Base
#initialize, name, #name, #resource_id, resource_id
Constructor Details
This class inherits a constructor from PSD::Resource::Section::Base
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
10 11 12 |
# File 'lib/psd/resources/slices.rb', line 10 def data @data end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
10 11 12 |
# File 'lib/psd/resources/slices.rb', line 10 def version @version end |
Instance Method Details
#parse ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/psd/resources/slices.rb', line 12 def parse @version = @file.read_int case @version when 6 then parse_legacy when 7, 8 then descriptor_version = @file.read_int @data = Descriptor.new(@file).parse end normalize_data! @resource.data = self end |
#to_a ⇒ Object
27 28 29 30 |
# File 'lib/psd/resources/slices.rb', line 27 def to_a return [] if @data.nil? @data[:slices] end |