Class: Wiki::Api::PageListItem
- Inherits:
-
Object
- Object
- Wiki::Api::PageListItem
- Defined in:
- lib/wiki/api/page_list_item.rb
Instance Attribute Summary collapse
-
#element ⇒ Object
Returns the value of attribute element.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ PageListItem
constructor
A new instance of PageListItem.
- #links ⇒ Object
- #to_text ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ PageListItem
Returns a new instance of PageListItem.
8 9 10 |
# File 'lib/wiki/api/page_list_item.rb', line 8 def initialize ={} self.element = [:element] if .include? :element end |
Instance Attribute Details
#element ⇒ Object
Returns the value of attribute element.
6 7 8 |
# File 'lib/wiki/api/page_list_item.rb', line 6 def element @element end |
Instance Method Details
#links ⇒ Object
16 17 18 19 20 |
# File 'lib/wiki/api/page_list_item.rb', line 16 def links self.search("a").map do |a| PageLink.new element: a end end |
#to_text ⇒ Object
12 13 14 |
# File 'lib/wiki/api/page_list_item.rb', line 12 def to_text Wiki::Api::Util.element_to_text self.element end |