Class: PnoteClient::Documents::Hml::Rectangle

Inherits:
Object
  • Object
show all
Defined in:
lib/pnote_client/documents/hml/rectangle.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeRectangle

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

#paragraphObject (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

  pg_tags = rect_tag.xpath("DRAWINGOBJECT/DRAWTEXT/PARALIST/P")
  pg_tags.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

#contentObject



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

Returns:

  • (Boolean)


33
34
35
# File 'lib/pnote_client/documents/hml/rectangle.rb', line 33

def textable?
  return true
end