Class: Obp::Access::RawHtmlParser

Inherits:
Parser
  • Object
show all
Defined in:
lib/obp/access/raw_html_parser.rb

Overview

Parser that converts an already-downloaded OBP HTML fragment (e.g. captured via a browser / waffle-punch) without touching the network. Duck-types with Parser for the Access pipeline.

Instance Attribute Summary

Attributes inherited from Parser

#directory, #urn

Instance Method Summary collapse

Methods inherited from Parser

#to_xml

Constructor Details

#initialize(urn:, directory:, html:, caption: nil, titles: nil) ⇒ RawHtmlParser

Returns a new instance of RawHtmlParser.



7
8
9
10
11
12
# File 'lib/obp/access/raw_html_parser.rb', line 7

def initialize(urn:, directory:, html:, caption: nil, titles: nil)
  super(urn:, directory:)
  @raw_html = html
  @caption = caption
  @raw_titles = titles
end

Instance Method Details

#available_languagesObject



18
19
20
# File 'lib/obp/access/raw_html_parser.rb', line 18

def available_languages
  [urn.language]
end

#htmlObject



14
15
16
# File 'lib/obp/access/raw_html_parser.rb', line 14

def html
  @raw_html
end