Class: Foxy::HtmlResponse

Inherits:
Object show all
Defined in:
lib/foxy/html_response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(html, params) ⇒ HtmlResponse

Returns a new instance of HtmlResponse.



5
6
7
8
# File 'lib/foxy/html_response.rb', line 5

def initialize(html, params)
  @html = html
  @params = params
end

Instance Attribute Details

#htmlObject

Returns the value of attribute html.



3
4
5
# File 'lib/foxy/html_response.rb', line 3

def html
  @html
end

#paramsObject

Returns the value of attribute params.



3
4
5
# File 'lib/foxy/html_response.rb', line 3

def params
  @params
end

Instance Method Details

#cleanObject



14
15
16
# File 'lib/foxy/html_response.rb', line 14

def clean
  @clean ||= foxy.clean(allow: %w(alt src href title class))
end

#foxyObject



10
11
12
# File 'lib/foxy/html_response.rb', line 10

def foxy
  @foxy ||= Foxy::Html.new(@html)
end