Sha256: 03ff5bcc94f4d1ca8f9cbf4d62c9396f0f0394c2208d002d70eefe5a4b8eabf7

Contents?: true

Size: 754 Bytes

Versions: 5

Compression:

Stored size: 754 Bytes

Contents

module Censys
  class HTTPResponse
    #
    # Initializes the HTTP Response infromation
    #
    # @param [Hash{String => Object}] attributes
    #
    def initialize(attributes)
      @attributes = attributes
    end

    #
    # HTTP body
    #
    # @return [String] body
    #
    def body
      @attributes.dig("get", "body")
    end

    #
    # HTTP header
    #
    # @return [Hash] header
    #
    def header
      @attributes.dig("get", "headers")
    end

    #
    # HTTP status code
    #
    # @return [Integer] status code
    #
    def status_code
      @attributes.dig("get", "status_code")
    end

    #
    # HTTP title
    #
    # @return [String] title
    #
    def title
      @attributes.dig("get", "title")
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
censu-0.1.6 lib/censys/http_response.rb
censu-0.1.5 lib/censys/http_response.rb
censu-0.1.4 lib/censys/http_response.rb
censu-0.1.3 lib/censys/http_response.rb
censu-0.1.2 lib/censys/http_response.rb