Class: HypermediaAPI::Document
- Inherits:
-
Object
- Object
- HypermediaAPI::Document
- Includes:
- Html
- Defined in:
- lib/api/document.rb
Instance Method Summary collapse
-
#headers ⇒ Object
Returns the document’s HTTP headers as a Hash.
-
#initialize(nokogiri_html, status, headers, http_basic_auth) ⇒ Document
constructor
Sets the HTML, status, headers, and auth info of the new document.
-
#status ⇒ Object
Returns the HTTP status code of the document as an integer.
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
#headers ⇒ Object
Returns the document’s HTTP headers as a Hash.
7 8 9 |
# File 'lib/api/document.rb', line 7 def headers @headers end |
#status ⇒ Object
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 |