Class: XX::Template::Inline

Inherits:
Basic
  • Object
show all
Defined in:
lib/xx.rb,
lib/xx-2.1.0.rb

Instance Method Summary collapse

Methods inherited from Basic

#expand, #inline_init, #path_init

Constructor Details

#initialize(*argv, &b) ⇒ Inline

–{{{

Raises:

  • (ArgumentError)


738
739
740
741
742
743
744
745
746
747
748
749
# File 'lib/xx.rb', line 738

def initialize *argv, &b
#--{{{
  opts, argv = argv.partition{|arg| Hash === arg}
  opts = opts.inject{|a,b| a.update b}
  inline = argv.shift || b.call
  raise ArgumentError, "no inline" unless inline
  raise ArgumentError, "bad opts" unless Hash === opts or opts.nil? 
  opts ||= {}
  opts['inline'] = opts[:inline] = inline.to_s
  super opts, &b
#--}}}
end