lib/epubber/models/concerns/has_endnotes.rb in epubber-0.0.4 vs lib/epubber/models/concerns/has_endnotes.rb in epubber-0.1.0
- old
+ new
@@ -1,13 +1,13 @@
require 'epubber/models/endnotes'
module Epubber::Models::Concerns
module HasEndnotes
- def endnotes(&block)
+ def endnotes
@endnotes ||= nil
return @endnotes unless block_given?
@endnotes = Epubber::Models::Endnotes.new
- @endnotes.instance_eval &block
+ yield @endnotes
end
def contextified_endnotes
return nil if endnotes.nil?
return endnotes.contextify