Class: Rack::Rekon::ResponseRewriters::HTML
- Inherits:
-
Object
- Object
- Rack::Rekon::ResponseRewriters::HTML
- Defined in:
- lib/rack/rekon/response_rewriters/html.rb
Instance Attribute Summary collapse
-
#app_root ⇒ Object
readonly
Returns the value of attribute app_root.
-
#doc ⇒ Object
readonly
Returns the value of attribute doc.
Instance Method Summary collapse
-
#initialize(app_root, body) ⇒ HTML
constructor
A new instance of HTML.
- #rewritten_body ⇒ Object
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_root ⇒ Object (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 |
#doc ⇒ Object (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_body ⇒ Object
12 13 14 15 |
# File 'lib/rack/rekon/response_rewriters/html.rb', line 12 def rewritten_body ensure_rewritten! doc.to_html end |