Sha256: 351ec1a716014780d60e10a3c019daecd5be0b7f7bc42958e2dbcc2cf73e2f55

Contents?: true

Size: 359 Bytes

Versions: 2

Compression:

Stored size: 359 Bytes

Contents

# Content helpers are used for small responses with Rack (usually in router.rb) for rendering pure text, or HTML.

module Socks
  class ContentHelpers

    # A pure text formatting
    def txt(str)
      [200, {'Content-type' => 'text/plain'}, ["#{str}"]]
    end

    def html(str)
      [200, {'Content-type' => 'text/html'}, ["#{str}"]]
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
socks-0.1.8.beta lib/socks/content_helpers.rb
socks-0.0.8.beta lib/socks/content_helpers.rb