Class: Bookfile::BookCtx
- Inherits:
-
Object
- Object
- Bookfile::BookCtx
- Defined in:
- lib/bookfile/book/book.rb
Instance Method Summary collapse
-
#initialize(config) ⇒ BookCtx
constructor
A new instance of BookCtx.
-
#page(name, opts = {}) {|ctx| ... } ⇒ Object
&block.
Constructor Details
#initialize(config) ⇒ BookCtx
Returns a new instance of BookCtx.
71 72 73 |
# File 'lib/bookfile/book/book.rb', line 71 def initialize( config ) @config = config end |
Instance Method Details
#page(name, opts = {}) {|ctx| ... } ⇒ Object
&block
75 76 77 78 79 80 81 82 |
# File 'lib/bookfile/book/book.rb', line 75 def page( name, opts={} ) ## &block puts "[BookCtx#page] #{name} opts:#{opts.inspect}" puts "[BookCtx#page] before yield" ctx = PageCtx.new( @config ) ## pass along book configs yield( ctx ) ## same as - ctx.instance_eval( &block ) puts "[BookCtx#page] after yield" end |