Module: Rango::FormatMixin

Defined in:
lib/rango/mixins/rendering.rb

Defined Under Namespace

Modules: ClassMethods

Constant Summary collapse

MIME_TYPES =
Rack::Mime::MIME_TYPES

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(controller) ⇒ Object



8
9
10
11
12
13
14
15
16
17
# File 'lib/rango/mixins/rendering.rb', line 8

def self.included(controller)
  controller.class_eval do
    extend ClassMethods
    extend Module.new {
      def inherited(subclass)
        subclass.formats = self.formats
      end
    }
  end
end

Instance Method Details

#initialize(*args) ⇒ Object



19
20
21
22
# File 'lib/rango/mixins/rendering.rb', line 19

def initialize(*args)
  super(*args)
  set_content_type
end

#set_content_typeObject

accept …



24
25
26
# File 'lib/rango/mixins/rendering.rb', line 24

def set_content_type # rango::controller
  # accept ...
end