Class: ApplePng
- Inherits:
-
Object
- Object
- ApplePng
- Defined in:
- lib/apple_png.rb,
ext/apple_png/apple_png.c
Instance Attribute Summary collapse
-
#height ⇒ Object
Returns the value of attribute height.
-
#raw_data ⇒ Object
readonly
Returns the value of attribute raw_data.
-
#width ⇒ Object
Returns the value of attribute width.
Instance Method Summary collapse
-
#data ⇒ String
Get the PNG data as string.
-
#initialize(apple_png_data) ⇒ ApplePng
constructor
Create a new ApplePng instance from Apple PNG data in a string.
Constructor Details
#initialize(apple_png_data) ⇒ ApplePng
Create a new ApplePng instance from Apple PNG data in a string
11 12 13 14 |
# File 'lib/apple_png.rb', line 11 def initialize(apple_png_data) self.get_dimensions(apple_png_data) @raw_data = apple_png_data end |
Instance Attribute Details
#height ⇒ Object
Returns the value of attribute height.
6 7 8 |
# File 'lib/apple_png.rb', line 6 def height @height end |
#raw_data ⇒ Object (readonly)
Returns the value of attribute raw_data.
7 8 9 |
# File 'lib/apple_png.rb', line 7 def raw_data @raw_data end |
#width ⇒ Object
Returns the value of attribute width.
6 7 8 |
# File 'lib/apple_png.rb', line 6 def width @width end |
Instance Method Details
#data ⇒ String
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.
18 19 20 21 |
# File 'lib/apple_png.rb', line 18 def data @data = self.convert_apple_png(@raw_data) if @data.nil? return @data end |