Class: Html2rss::SST::Document
- Inherits:
-
Data
- Object
- Data
- Html2rss::SST::Document
- Defined in:
- lib/html2rss/sst/document.rb
Overview
Immutable SST document: root node plus relationship index.
Instance Attribute Summary collapse
-
#degraded ⇒ Object
readonly
Returns the value of attribute degraded.
-
#index ⇒ Object
readonly
Returns the value of attribute index.
-
#node_count ⇒ Object
readonly
Returns the value of attribute node_count.
-
#root ⇒ Object
readonly
Returns the value of attribute root.
Class Method Summary collapse
Instance Attribute Details
#degraded ⇒ Object (readonly)
Returns the value of attribute degraded
7 8 9 |
# File 'lib/html2rss/sst/document.rb', line 7 def degraded @degraded end |
#index ⇒ Object (readonly)
Returns the value of attribute index
7 8 9 |
# File 'lib/html2rss/sst/document.rb', line 7 def index @index end |
#node_count ⇒ Object (readonly)
Returns the value of attribute node_count
7 8 9 |
# File 'lib/html2rss/sst/document.rb', line 7 def node_count @node_count end |
#root ⇒ Object (readonly)
Returns the value of attribute root
7 8 9 |
# File 'lib/html2rss/sst/document.rb', line 7 def root @root end |
Class Method Details
.build(root:, index:, degraded: false, node_count: 0) ⇒ Document
15 16 17 18 19 20 |
# File 'lib/html2rss/sst/document.rb', line 15 def self.build(root:, index:, degraded: false, node_count: 0) raise ArgumentError, 'root is required' unless root.is_a?(Node) raise ArgumentError, 'index is required' unless index.is_a?(Index) new(root:, index:, degraded: !!degraded, node_count: Integer(node_count)) end |