Class: OpenContent::Extractor

Inherits:
Object
  • Object
show all
Defined in:
lib/helpers/open_content/extractor.rb

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.loggerObject (readonly)

Returns the value of attribute logger.



6
7
8
# File 'lib/helpers/open_content/extractor.rb', line 6

def logger
  @logger
end

Class Method Details

.process(source, logger) ⇒ Object

Raises:

  • (ArgumentError)


8
9
10
11
12
13
# File 'lib/helpers/open_content/extractor.rb', line 8

def process(source, logger)
  @logger = logger
  extract_locally(source) or extract_remotely(source) or extract_from_string(source)
  raise ArgumentError, "Could not determine what #{source.inspect} was.  Cannot extract this data." unless @raw
  @raw
end