Class: Rack::Lettering

Inherits:
Object
  • Object
show all
Defined in:
lib/rack/lettering.rb,
lib/rack/lettering/version.rb

Constant Summary collapse

VERSION =
'0.1.1'

Instance Method Summary collapse

Constructor Details

#initialize(app, options = {}) ⇒ Lettering

Returns a new instance of Lettering.



7
8
9
10
11
12
# File 'lib/rack/lettering.rb', line 7

def initialize(app, options = {})
  @app      = app
  @words    = options[:words] || []
  @letters  = options[:letters] || []
  @lines    = options[:lines] || []
end

Instance Method Details

#call(env) ⇒ Object



14
15
16
17
18
19
20
21
22
23
# File 'lib/rack/lettering.rb', line 14

def call(env)
  status, @headers, @body = @app.call(env)

  if html?
    apply_lettering
    update_content_length
  end

  [status, @headers, @body]
end