Class: ImageInfo::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/image_info/parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(image, data) ⇒ Parser

Returns a new instance of Parser.



8
9
10
11
12
# File 'lib/image_info/parser.rb', line 8

def initialize(image, data)
  @image  = image
  @bytes  = data.bytes
  @parser = ::ImageSize.new(data)
end

Instance Attribute Details

#bytesObject (readonly)

Returns the value of attribute bytes.



6
7
8
# File 'lib/image_info/parser.rb', line 6

def bytes
  @bytes
end

#imageObject (readonly)

Returns the value of attribute image.



6
7
8
# File 'lib/image_info/parser.rb', line 6

def image
  @image
end

#parserObject (readonly)

Returns the value of attribute parser.



6
7
8
# File 'lib/image_info/parser.rb', line 6

def parser
  @parser
end

Instance Method Details

#callObject



14
15
16
17
# File 'lib/image_info/parser.rb', line 14

def call
  set_image_size
  set_image_type
end