Class: Censys::HTTPResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/censys/http_response.rb

Instance Method Summary collapse

Constructor Details

#initialize(attributes) ⇒ HTTPResponse

Initializes the HTTP Response infromation

Parameters:

  • attributes (Hash{String => Object})


10
11
12
# File 'lib/censys/http_response.rb', line 10

def initialize(attributes)
  @attributes = attributes
end

Instance Method Details

#bodyString

HTTP body

Returns:

  • (String)

    body



19
20
21
# File 'lib/censys/http_response.rb', line 19

def body
  @attributes.dig("get", "body")
end

#headerHash

HTTP header

Returns:

  • (Hash)

    header



28
29
30
# File 'lib/censys/http_response.rb', line 28

def header
  @attributes.dig("get", "headers")
end

#status_codeInteger

HTTP status code

Returns:

  • (Integer)

    status code



37
38
39
# File 'lib/censys/http_response.rb', line 37

def status_code
  @attributes.dig("get", "status_code")
end

#titleString

HTTP title

Returns:

  • (String)

    title



46
47
48
# File 'lib/censys/http_response.rb', line 46

def title
  @attributes.dig("get", "title")
end