Class: VitalsImage::Analyzer::UrlAnalyzer
Instance Attribute Summary
#source
Class Method Summary
collapse
Instance Method Summary
collapse
#initialize, #logger
Class Method Details
.accept?(source) ⇒ Boolean
7
8
9
|
# File 'lib/vitals_image/analyzer/url_analyzer.rb', line 7
def self.accept?(source)
source.is_a?(Source)
end
|
Instance Method Details
#analyze ⇒ Object
11
12
13
14
15
16
17
|
# File 'lib/vitals_image/analyzer/url_analyzer.rb', line 11
def analyze
file = download
image = open(file)
mime = Marcel::MimeType.for(Pathname.new file.path)
source.update width: image.width, height: image.height, analyzed: true, content_type: mime
end
|