Class: PnoteClient::Documents::Hml::Rectangle
- Inherits:
-
Object
- Object
- PnoteClient::Documents::Hml::Rectangle
- Defined in:
- lib/pnote_client/documents/hml/rectangle.rb
Instance Attribute Summary collapse
-
#paragraph ⇒ Object
readonly
Returns the value of attribute paragraph.
Class Method Summary collapse
Instance Method Summary collapse
- #add_paragraph(new_paragraph) ⇒ Object
- #content ⇒ Object
-
#initialize ⇒ Rectangle
constructor
A new instance of Rectangle.
- #textable? ⇒ Boolean
Constructor Details
#initialize ⇒ Rectangle
Returns a new instance of Rectangle.
21 22 23 |
# File 'lib/pnote_client/documents/hml/rectangle.rb', line 21 def initialize @paragraphs = [] end |
Instance Attribute Details
#paragraph ⇒ Object (readonly)
Returns the value of attribute paragraph.
19 20 21 |
# File 'lib/pnote_client/documents/hml/rectangle.rb', line 19 def paragraph @paragraph end |
Class Method Details
.from_tag(rect_tag) ⇒ Object
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/pnote_client/documents/hml/rectangle.rb', line 8 def self.from_tag(rect_tag) rect = self.new = rect_tag.xpath("DRAWINGOBJECT/DRAWTEXT/PARALIST/P") .each do |pg_tag| rect.add_paragraph(Paragraph.from_tag(pg_tag)) end return rect end |
Instance Method Details
#add_paragraph(new_paragraph) ⇒ Object
25 26 27 |
# File 'lib/pnote_client/documents/hml/rectangle.rb', line 25 def add_paragraph(new_paragraph) @paragraphs << new_paragraph end |
#content ⇒ Object
29 30 31 |
# File 'lib/pnote_client/documents/hml/rectangle.rb', line 29 def content @paragraphs.map {|pg| pg.content}.join("\n") end |
#textable? ⇒ Boolean
33 34 35 |
# File 'lib/pnote_client/documents/hml/rectangle.rb', line 33 def textable? return true end |