Sha256: ec09a205aa7022834fb1f90a266892356e3e8c5e44031dac4cba5f71c903e572

Contents?: true

Size: 505 Bytes

Versions: 1

Compression:

Stored size: 505 Bytes

Contents

require 'celluloid'
require 'faraday'

module Nacjac
  class Projectile
    include Celluloid

    def initialize(target_url)
      @target_url = target_url
      @conn = Faraday.new(:url => 'http://sushi.com') 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.1 lib/nacjac/projectile.rb