Sha256: 45c001a263060c13341a28c10ad2c0cc52fe81b536497bb0222debb5ebdc3555

Contents?: true

Size: 497 Bytes

Versions: 1

Compression:

Stored size: 497 Bytes

Contents

require 'celluloid'
require 'faraday'

module Nacjac
  class Projectile
    include Celluloid

    def initialize(target_url)
      @target_url = target_url
      @conn = Faraday.new(:url => target_url) do |faraday|
        faraday.request  :url_encoded
        faraday.adapter  Faraday.default_adapter
      end
    end

    def launch
      start_time = Time.now
      response = @conn.get @target_url
      end_time = Time.now
      end_time - start_time
    rescue
      nil
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
nacjac-0.0.2 lib/nacjac/projectile.rb