Class: HypermediaAPI::Document

Inherits:
Object
  • Object
show all
Includes:
Html
Defined in:
lib/api/document.rb

Instance Method Summary collapse

Methods included from Html

#auth, #entities, #entity, #form, #html, #link

Constructor Details

#initialize(nokogiri_html, status, headers, http_basic_auth) ⇒ Document

Sets the HTML, status, headers, and auth info of the new document.



12
13
14
15
16
17
# File 'lib/api/document.rb', line 12

def initialize (nokogiri_html, status, headers, http_basic_auth)
  @nhtml = nokogiri_html
  @status = status.to_i
  @headers = headers
  @http_basic_auth = http_basic_auth
end

Instance Method Details

#headersObject

Returns the document’s HTTP headers as a Hash.



7
8
9
# File 'lib/api/document.rb', line 7

def headers
  @headers
end

#statusObject

Returns the HTTP status code of the document as an integer.



20
21
22
# File 'lib/api/document.rb', line 20

def status
  @status
end