Class: OpenStax::Cnx::V1::Paragraph
- Defined in:
- lib/openstax/cnx/v1/paragraph.rb
Constant Summary collapse
- MATCH_PARAGRAPH =
'//p[@id]'
Instance Attribute Summary
Attributes inherited from Element
Class Method Summary collapse
Instance Method Summary collapse
- #id ⇒ Object
-
#initialize(node:) ⇒ Paragraph
constructor
A new instance of Paragraph.
- #text ⇒ Object
Constructor Details
#initialize(node:) ⇒ Paragraph
Returns a new instance of Paragraph.
5 6 7 |
# File 'lib/openstax/cnx/v1/paragraph.rb', line 5 def initialize(node:) super end |
Class Method Details
.matcher ⇒ Object
17 18 19 |
# File 'lib/openstax/cnx/v1/paragraph.rb', line 17 def self.matcher MATCH_PARAGRAPH end |
.matches?(node) ⇒ Boolean
21 22 23 |
# File 'lib/openstax/cnx/v1/paragraph.rb', line 21 def self.matches?(node) node.matches?(MATCH_PARAGRAPH) end |
Instance Method Details
#id ⇒ Object
13 14 15 |
# File 'lib/openstax/cnx/v1/paragraph.rb', line 13 def id node.attr('id') end |
#text ⇒ Object
9 10 11 |
# File 'lib/openstax/cnx/v1/paragraph.rb', line 9 def text node.text end |