Module: FN::Block

Defined in:
lib/fn/block.rb

Instance Method Summary collapse

Instance Method Details

#content?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/fn/block.rb', line 7

def content?
  content && !content.empty?
end

#indexObject



19
20
21
# File 'lib/fn/block.rb', line 19

def index
  self["index"] && self["index"].to_i
end

#page_numberObject



3
4
5
# File 'lib/fn/block.rb', line 3

def page_number
  find_first("ancestor::page")["number"].to_i
end

#sort_keyObject



23
24
25
# File 'lib/fn/block.rb', line 23

def sort_key
  "#{text}-#{index}"
end

#srcObject



15
16
17
# File 'lib/fn/block.rb', line 15

def src
  self["src"]
end

#textObject



11
12
13
# File 'lib/fn/block.rb', line 11

def text
  self["text"]
end