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})


8
9
10
# File 'lib/censys/http_response.rb', line 8

def initialize(attributes)
  @attributes = attributes
end

Instance Method Details

#bodyString

HTTP body

Returns:

  • (String)

    body



17
18
19
# File 'lib/censys/http_response.rb', line 17

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

#headerHash

HTTP header

Returns:

  • (Hash)

    header



26
27
28
# File 'lib/censys/http_response.rb', line 26

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

#status_codeInteger

HTTP status code

Returns:

  • (Integer)

    status code



35
36
37
# File 'lib/censys/http_response.rb', line 35

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

#titleString

HTTP title

Returns:

  • (String)

    title



44
45
46
# File 'lib/censys/http_response.rb', line 44

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