Class: Hypermicrodata::Document
- Inherits:
-
Object
- Object
- Hypermicrodata::Document
- Defined in:
- lib/hypermicrodata/document.rb
Instance Attribute Summary collapse
-
#doc ⇒ Object
readonly
Returns the value of attribute doc.
-
#items ⇒ Object
readonly
Returns the value of attribute items.
Instance Method Summary collapse
- #extract_items ⇒ Object
-
#initialize(content, options = {}) ⇒ Document
constructor
A new instance of Document.
Constructor Details
#initialize(content, options = {}) ⇒ Document
Returns a new instance of Document.
6 7 8 9 10 11 12 |
# File 'lib/hypermicrodata/document.rb', line 6 def initialize(content, = {}) encoding = [:force_encoding] || nil @doc = Nokogiri::HTML(content, nil, encoding) @page_url = [:page_url] @filter_xpath_attr = [:filter_xpath_attr] @items = extract_items end |
Instance Attribute Details
#doc ⇒ Object (readonly)
Returns the value of attribute doc.
4 5 6 |
# File 'lib/hypermicrodata/document.rb', line 4 def doc @doc end |
#items ⇒ Object (readonly)
Returns the value of attribute items.
4 5 6 |
# File 'lib/hypermicrodata/document.rb', line 4 def items @items end |