Module: Roda::RodaPlugins::Assets::RequestMethods

Defined in:
lib/roda/plugins/assets.rb

Instance Method Summary collapse

Instance Method Details

#assetsObject

Render the matching asset if this is a GET request for a supported asset.



885
886
887
888
889
890
891
892
893
894
# File 'lib/roda/plugins/assets.rb', line 885

def assets
  if is_get?
    self.class.assets_matchers.each do |type, matcher|
      is matcher do |file|
        scope.render_asset(file, type)
      end
    end
    nil
  end
end