Class: Html::Merge::FileAnalysis
- Inherits:
-
Object
- Object
- Html::Merge::FileAnalysis
- Defined in:
- lib/html/merge/file_analysis.rb,
sig/html/merge.rbs
Overview
One native parser pass proving HTML structure, explicit IDs, and safe source ranges.
Instance Attribute Summary collapse
-
#backend ⇒ Symbol
readonly
Returns the value of attribute backend.
-
#document_semantics ⇒ Object
readonly
Returns the value of attribute document_semantics.
-
#errors ⇒ Array[untyped]
readonly
Returns the value of attribute errors.
-
#issues ⇒ Array[Hash[Symbol, untyped]]
readonly
Returns the value of attribute issues.
-
#root_node ⇒ Object
readonly
Returns the value of attribute root_node.
-
#source ⇒ String
readonly
Returns the value of attribute source.
-
#wrappers ⇒ Array[NodeWrapper]
readonly
Returns the value of attribute wrappers.
Instance Method Summary collapse
-
#initialize(source) ⇒ FileAnalysis
constructor
A new instance of FileAnalysis.
- #valid? ⇒ Boolean
Constructor Details
#initialize(source) ⇒ FileAnalysis
Returns a new instance of FileAnalysis.
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/html/merge/file_analysis.rb', line 9 def initialize(source) @source = source.to_s @backend = BACKEND_REFERENCE.id.to_sym @errors = [] parse! rescue StandardError => e @root_node = nil @wrappers = [].freeze @document_semantics = nil @issues = [].freeze @errors = [e].freeze end |
Instance Attribute Details
#backend ⇒ Symbol (readonly)
Returns the value of attribute backend.
7 8 9 |
# File 'lib/html/merge/file_analysis.rb', line 7 def backend @backend end |
#document_semantics ⇒ Object (readonly)
Returns the value of attribute document_semantics.
7 8 9 |
# File 'lib/html/merge/file_analysis.rb', line 7 def document_semantics @document_semantics end |
#errors ⇒ Array[untyped] (readonly)
Returns the value of attribute errors.
7 8 9 |
# File 'lib/html/merge/file_analysis.rb', line 7 def errors @errors end |
#issues ⇒ Array[Hash[Symbol, untyped]] (readonly)
Returns the value of attribute issues.
7 8 9 |
# File 'lib/html/merge/file_analysis.rb', line 7 def issues @issues end |
#root_node ⇒ Object (readonly)
Returns the value of attribute root_node.
7 8 9 |
# File 'lib/html/merge/file_analysis.rb', line 7 def root_node @root_node end |
#source ⇒ String (readonly)
Returns the value of attribute source.
7 8 9 |
# File 'lib/html/merge/file_analysis.rb', line 7 def source @source end |
#wrappers ⇒ Array[NodeWrapper] (readonly)
Returns the value of attribute wrappers.
7 8 9 |
# File 'lib/html/merge/file_analysis.rb', line 7 def wrappers @wrappers end |
Instance Method Details
#valid? ⇒ Boolean
22 |
# File 'lib/html/merge/file_analysis.rb', line 22 def valid? = errors.empty? |