Class: MicroMagick::IdentifyParser

Inherits:
Object
  • Object
show all
Defined in:
lib/micro_magick/identify_parser.rb

Constant Summary collapse

DIMENSIONS_RE =
/(\d+)x(\d+)/

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(stdout) ⇒ IdentifyParser

Returns a new instance of IdentifyParser.



7
8
9
10
11
# File 'lib/micro_magick/identify_parser.rb', line 7

def initialize(stdout)
  if (m = stdout.match(DIMENSIONS_RE))
    @width, @height = m[1].to_i, m[2].to_i
  end
end

Instance Attribute Details

#heightObject (readonly)

Returns the value of attribute height.



6
7
8
# File 'lib/micro_magick/identify_parser.rb', line 6

def height
  @height
end

#widthObject (readonly)

Returns the value of attribute width.



6
7
8
# File 'lib/micro_magick/identify_parser.rb', line 6

def width
  @width
end