Class: Bookfile::BookCtx

Inherits:
Object
  • Object
show all
Defined in:
lib/bookfile/book/book.rb

Instance Method Summary collapse

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

Yields:

  • (ctx)


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