Module: Yaks::Sinatra

Defined in:
lib/yaks-sinatra.rb

Defined Under Namespace

Modules: Helpers

Class Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Class Attribute Details

.yaks_configObject

Returns the value of attribute yaks_config.



7
8
9
# File 'lib/yaks-sinatra.rb', line 7

def yaks_config
  @yaks_config
end

Class Method Details

.registered(app) ⇒ Object



28
29
30
31
32
33
34
35
36
# File 'lib/yaks-sinatra.rb', line 28

def self.registered(app)
  app.helpers(Yaks::Sinatra::Helpers)

  ::Yaks::Format.all.each do |format|
    app.settings.add_charset << format.media_type
  end

  # app.configure_yaks
end

Instance Method Details

#configure_yaks(&block) ⇒ Object



18
19
20
21
22
23
24
25
26
# File 'lib/yaks-sinatra.rb', line 18

def configure_yaks(&block)
  Yaks::Sinatra.yaks_config = ::Yaks.new(&block)

  configure do
    ::Yaks::Format.all.each do |format|
      mime_type format.format_name, format.media_type
    end
  end
end