Class: Rack::Rekon::ResponseRewriters::HTML

Inherits:
Object
  • Object
show all
Defined in:
lib/rack/rekon/response_rewriters/html.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(app_root, body) ⇒ HTML

Returns a new instance of HTML.



8
9
10
# File 'lib/rack/rekon/response_rewriters/html.rb', line 8

def initialize(app_root, body)
  @app_root, @doc = app_root, Nokogiri::HTML(body)
end

Instance Attribute Details

#app_rootObject (readonly)

Returns the value of attribute app_root.



7
8
9
# File 'lib/rack/rekon/response_rewriters/html.rb', line 7

def app_root
  @app_root
end

#docObject (readonly)

Returns the value of attribute doc.



7
8
9
# File 'lib/rack/rekon/response_rewriters/html.rb', line 7

def doc
  @doc
end

Instance Method Details

#rewritten_bodyObject



12
13
14
15
# File 'lib/rack/rekon/response_rewriters/html.rb', line 12

def rewritten_body
  ensure_rewritten!
  doc.to_html
end