apple_png 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/apple_png.rb +2 -4
- metadata +1 -1
data/lib/apple_png.rb
CHANGED
@@ -4,6 +4,7 @@ class NotValidApplePngError < StandardError; end
|
|
4
4
|
|
5
5
|
class ApplePng
|
6
6
|
attr_accessor :width, :height
|
7
|
+
attr_reader :raw_data
|
7
8
|
|
8
9
|
# Create a new ApplePng instance from Apple PNG data in a string
|
9
10
|
# @param apple_png_data [String] Binary string containing Apple PNG data, probably read from a file
|
@@ -15,10 +16,7 @@ class ApplePng
|
|
15
16
|
# Get the PNG data as string. The conversion from Apple PNG data to standard PNG data will be performed when this method is first called.
|
16
17
|
# @return [String] Binary string containing standard PNG data
|
17
18
|
def data
|
18
|
-
if @data.nil?
|
19
|
-
@data = self.convert_apple_png(@raw_data)
|
20
|
-
@raw_data = nil
|
21
|
-
end
|
19
|
+
@data = self.convert_apple_png(@raw_data) if @data.nil?
|
22
20
|
return @data
|
23
21
|
end
|
24
22
|
end
|