Class: Montague::Reporter::Journals

Inherits:
Object
  • Object
show all
Defined in:
lib/montague/reporter/journals.rb

Overview

Journals reporter

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ Journals

Returns a new instance of Journals.


7
8
9
10
11
12
# File 'lib/montague/reporter/journals.rb', line 7

def initialize(response)
  @response = response
  @header_extractor = Montague::XMLExtractor::Header.new response.to_s
  @journal_extractor = Montague::XMLExtractor::Journal.new response.to_s
  @publisher_extractor = Montague::XMLExtractor::Publisher.new response.to_s
end

Instance Method Details

#reportMontague::Model::JournalsReport


15
16
17
18
19
20
21
22
# File 'lib/montague/reporter/journals.rb', line 15

def report
  h = Montague::Model::JournalsReport.new
  h.http_response = @response
  h.header = @header_extractor.model
  h.journals = @journal_extractor.models
  h.publisher = @publisher_extractor.model
  h
end