Class: Tsumamigui::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/tsumamigui/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url, html, charset) ⇒ Response

Returns a new instance of Response.

Parameters:

  • url (String)
  • html (String)
  • charset (String)


13
14
15
16
17
# File 'lib/tsumamigui/response.rb', line 13

def initialize(url, html, charset)
  @url = url
  @html = html
  @charset = charset
end

Instance Attribute Details

#charsetObject (readonly)

charset of fetched html



8
9
10
# File 'lib/tsumamigui/response.rb', line 8

def charset
  @charset
end

#htmlObject (readonly)

fetched html



6
7
8
# File 'lib/tsumamigui/response.rb', line 6

def html
  @html
end

#urlObject (readonly)

request url



4
5
6
# File 'lib/tsumamigui/response.rb', line 4

def url
  @url
end

Instance Method Details

#to_arrayArray

Convert request data to array

Returns:

  • (Array)
    url, html, charset


21
22
23
# File 'lib/tsumamigui/response.rb', line 21

def to_array
  [@url, @html, @charset]
end