Class: VitalsImage::Analyzer

Inherits:
Object
  • Object
show all
Defined in:
lib/vitals_image/analyzer.rb

Overview

This is an abstract base class for dimension calculators

Direct Known Subclasses

UrlAnalyzer

Defined Under Namespace

Classes: UrlAnalyzer

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source) ⇒ Analyzer

Returns a new instance of Analyzer.



14
15
16
# File 'lib/vitals_image/analyzer.rb', line 14

def initialize(source)
  @source = source
end

Instance Attribute Details

#sourceObject (readonly)

Returns the value of attribute source.



6
7
8
# File 'lib/vitals_image/analyzer.rb', line 6

def source
  @source
end

Class Method Details

.accept?(source) ⇒ Boolean

Implement this method in a concrete subclass. Have it return true when given a source from which it can calculate dimensions

Returns:

  • (Boolean)


10
11
12
# File 'lib/vitals_image/analyzer.rb', line 10

def self.accept?(source)
  false
end

Instance Method Details

#loggerObject



18
19
20
# File 'lib/vitals_image/analyzer.rb', line 18

def logger
  VitalsImage.logger
end