Method: Inversion::Template#method_missing

Defined in:
lib/inversion/template.rb

#method_missing(sym, *args, &block) ⇒ Object (protected)

Proxy method: handle attribute readers/writers for attributes that aren’t yet defined.

Raises:

  • (NoMethodError)


397
398
399
400
401
402
403
404
405
406
407
408
# File 'lib/inversion/template.rb', line 397

def method_missing( sym, *args, &block )
  return super unless sym.to_s =~ /^([a-z]\w+)=?$/i
  attribute = $1

  raise NoMethodError, "no tag attribute '%s' (strict mode)" % [ attribute ] if
    self.options[:strict_attributes]

  self.install_accessors( attribute )

  # Call the new method via #method to avoid a method_missing loop.
  return self.method( sym ).call( *args, &block )
end