Class: Utopia::Controller::Responder::Handler

Inherits:
Struct
  • Object
show all
Defined in:
lib/utopia/controller/responder.rb

Overview

A content-type handler and its response block.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#blockObject

Returns the value of attribute block

Returns:

  • (Object)

    the current value of block



69
70
71
# File 'lib/utopia/controller/responder.rb', line 69

def block
  @block
end

#content_typeObject

Returns the value of attribute content_type

Returns:

  • (Object)

    the current value of content_type



69
70
71
# File 'lib/utopia/controller/responder.rb', line 69

def content_type
  @content_type
end

Instance Method Details

#call(context, request, media_range, *arguments, **options) ⇒ Object

Invoke this handler's block in the controller context.



77
78
79
# File 'lib/utopia/controller/responder.rb', line 77

def call(context, request, media_range, *arguments, **options)
	context.instance_exec(media_range, *arguments, **options, &self.block)
end