class Shrine::Plugins::StoreDimensions::DimensionsAnalyzer

  1. lib/shrine/plugins/store_dimensions.rb
Superclass: Object

Methods

Public Class

  1. new

Public Instance

  1. call

Constants

SUPPORTED_TOOLS = [:fastimage]  

Public Class methods

new (tool)
[show source]
# File lib/shrine/plugins/store_dimensions.rb, line 115
def initialize(tool)
  raise ArgumentError, "unsupported dimensions analysis tool: #{tool}" unless SUPPORTED_TOOLS.include?(tool)

  @tool = tool
end

Public Instance methods

call (io)
[show source]
# File lib/shrine/plugins/store_dimensions.rb, line 121
def call(io)
  dimensions = send(:"extract_with_#{@tool}", io)
  io.rewind
  dimensions
end