Class: XX::Template::File

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) ⇒ File

–{{{

Raises:

  • (ArgumentError)


721
722
723
724
725
726
727
728
729
730
731
732
# File 'lib/xx.rb', line 721

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