Module: FN::Block
- Defined in:
- lib/fn/block.rb
Instance Method Summary collapse
- #content? ⇒ Boolean
- #index ⇒ Object
- #page_number ⇒ Object
- #sort_key ⇒ Object
- #src ⇒ Object
- #text ⇒ Object
Instance Method Details
#content? ⇒ Boolean
7 8 9 |
# File 'lib/fn/block.rb', line 7 def content? content && !content.empty? end |
#index ⇒ Object
19 20 21 |
# File 'lib/fn/block.rb', line 19 def index self["index"] && self["index"].to_i end |
#page_number ⇒ Object
3 4 5 |
# File 'lib/fn/block.rb', line 3 def page_number find_first("ancestor::page")["number"].to_i end |
#sort_key ⇒ Object
23 24 25 |
# File 'lib/fn/block.rb', line 23 def sort_key "#{text}-#{index}" end |
#src ⇒ Object
15 16 17 |
# File 'lib/fn/block.rb', line 15 def src self["src"] end |
#text ⇒ Object
11 12 13 |
# File 'lib/fn/block.rb', line 11 def text self["text"] end |