Class: Web::Wiki::Request::Action

Inherits:
Object
  • Object
show all
Defined in:
lib/web/wiki.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, &action) ⇒ Action

Returns a new instance of Action.



393
394
395
396
397
# File 'lib/web/wiki.rb', line 393

def initialize( name, &action )
  @name = name
  @action = action
  Request.actions[name] = self
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



392
393
394
# File 'lib/web/wiki.rb', line 392

def name
  @name
end

Instance Method Details

#call(request) ⇒ Object



399
400
401
402
403
404
405
406
407
408
409
410
# File 'lib/web/wiki.rb', line 399

def call( request )
  if (self.name == "default")
    request.content_template = request.page.template
  else
    request.content_template = self.name + ".html"
  end
  @action.call(request) if @action
  if ( [ "illustration.html",
        "images.html" ].include? request.content_template )
    request.template = request.content_template
  end
end