Class: Panchira::ImageResolver

Inherits:
Resolver
  • Object
show all
Defined in:
lib/panchira/resolvers/image_resolver.rb

Constant Summary collapse

URL_REGEXP =
/\.(png|gif|jpg|jpeg|webp)$/.freeze

Instance Method Summary collapse

Methods inherited from Resolver

applicable?, #initialize

Constructor Details

This class inherits a constructor from Panchira::Resolver

Instance Method Details

#fetchObject



7
8
9
10
11
12
13
14
15
16
# File 'lib/panchira/resolvers/image_resolver.rb', line 7

def fetch
  result = PanchiraResult.new
  result.canonical_url = @url
  result.image = PanchiraImage.new
  result.image.url = @url
  result.image.width, result.image.height = FastImage.size(result.image.url)

  result.resolver = parse_resolver
  result
end