Files

Ruport::Controller::Hooks::ClassMethods

Public Instance Methods

controller() click to toggle source

The class of the controller object for the base class.

Example:

>> Ruport::Data::Table.controller
=> Ruport::Controller::Table
# File lib/ruport/controller.rb, line 149
def controller
  @controller
end
rendering_options() click to toggle source

The default rendering options for a class, stored as a hash.

# File lib/ruport/controller.rb, line 115
def rendering_options
  @rendering_options
end
renders_as_group(options={}) click to toggle source

Shortcut for renders_with(Ruport::Controller::Group), you may wish to override this if you build a custom group controller.

# File lib/ruport/controller.rb, line 133
def renders_as_group(options={})
  renders_with Ruport::Controller::Group,options
end
renders_as_grouping(options={}) click to toggle source

Shortcut for renders_with(Ruport::Controller::Grouping), you may wish to override this if you build a custom grouping controller.

# File lib/ruport/controller.rb, line 139
def renders_as_grouping(options={})
  renders_with Ruport::Controller::Grouping,options
end
renders_as_row(options={}) click to toggle source

Shortcut for renders_with(Ruport::Controller::Row), you may wish to override this if you build a custom row controller.

# File lib/ruport/controller.rb, line 127
def renders_as_row(options={})
  renders_with Ruport::Controller::Row, options
end
renders_as_table(options={}) click to toggle source

Shortcut for renders_with(Ruport::Controller::Table), you may wish to override this if you build a custom table controller.

# File lib/ruport/controller.rb, line 121
def renders_as_table(options={})
  renders_with Ruport::Controller::Table,options
end
renders_with(controller,opts={}) click to toggle source

Tells the class which controller as() will forward to.

Usage:

class MyStructure
  include Controller::Hooks
  renders_with CustomController
end

You can also specify default rendering options, which will be used if they are not overriden by the options passed to as().

class MyStructure
  include Controller::Hooks
  renders_with CustomController, :font_size => 14
end
# File lib/ruport/controller.rb, line 109
def renders_with(controller,opts={})
  @controller = controller
  @rendering_options=opts
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.