Class: ActiveStorageValidations::Analyzer::ImageAnalyzer::ImageMagick::ImageInfo

Inherits:
Struct
  • Object
show all
Defined in:
lib/active_storage_validations/analyzer/image_analyzer/image_magick.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#heightObject

Returns the value of attribute height

Returns:

  • (Object)

    the current value of height



10
11
12
# File 'lib/active_storage_validations/analyzer/image_analyzer/image_magick.rb', line 10

def height
  @height
end

#orientationObject

Returns the value of attribute orientation

Returns:

  • (Object)

    the current value of orientation



10
11
12
# File 'lib/active_storage_validations/analyzer/image_analyzer/image_magick.rb', line 10

def orientation
  @orientation
end

#widthObject

Returns the value of attribute width

Returns:

  • (Object)

    the current value of width



10
11
12
# File 'lib/active_storage_validations/analyzer/image_analyzer/image_magick.rb', line 10

def width
  @width
end

Instance Method Details

#[](key) ⇒ Object



15
16
17
# File 'lib/active_storage_validations/analyzer/image_analyzer/image_magick.rb', line 15

def [](key)
  orientation if key == "%[orientation]"
end

#valid?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/active_storage_validations/analyzer/image_analyzer/image_magick.rb', line 11

def valid?
  width.to_i.positive? && height.to_i.positive?
end