class Cuprum::Rails::Controllers::Configuration

Data object that stores a controller's configuration.

Attributes

controller[R]

@return [#resource, responders] the controller to delegate configuration.

Public Class Methods

new(controller) click to toggle source

@param controller [#resource, responders] The controller to delegate

configuration.
# File lib/cuprum/rails/controllers/configuration.rb, line 14
def initialize(controller)
  @controller = controller
end

Public Instance Methods

responder_for(format) click to toggle source

Finds the configured responder for the requested format.

@param format [Symbol] The format to respond to.

@return [Class] the responder class defined for the format.

@raise [Cuprum::Rails::Controller::UnknownFormatError] if the controller

does not define a responder for the given format.
# File lib/cuprum/rails/controllers/configuration.rb, line 46
def responder_for(format)
  responders.fetch(format) do
    raise Cuprum::Rails::Controller::UnknownFormatError,
      "no responder registered for format #{format.inspect}"
  end
end