Module: Praxis::Controller
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
- #definition ⇒ Object
- #initialize(request, response = Responses::Ok.new) ⇒ Object
- #inspect ⇒ Object
- #media_type ⇒ Object
Instance Method Details
#definition ⇒ Object
42 43 44 |
# File 'lib/praxis/controller.rb', line 42 def definition self.class.definition end |
#initialize(request, response = Responses::Ok.new) ⇒ Object
33 34 35 36 |
# File 'lib/praxis/controller.rb', line 33 def initialize(request, response = Responses::Ok.new) @request = request @response = response end |
#inspect ⇒ Object
38 39 40 |
# File 'lib/praxis/controller.rb', line 38 def inspect "#<#{self.class}##{object_id} @request=#{@request.inspect}>" end |
#media_type ⇒ Object
46 47 48 49 50 51 52 |
# File 'lib/praxis/controller.rb', line 46 def media_type if (response_definition = request.action.responses[response.name]) response_definition.media_type else definition.media_type end end |