Class: Concuss

Inherits:
Object
  • Object
show all
Defined in:
lib/concuss.rb,
lib/concuss/version.rb

Defined Under Namespace

Classes: Error, Headers, Runner

Constant Summary collapse

VERSION =
"0.1.0"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url:, file: nil, header_set: :all, test_string: nil) ⇒ Concuss

Returns a new instance of Concuss.



8
9
10
11
12
13
14
15
# File 'lib/concuss.rb', line 8

def initialize(url:, file: nil, header_set: :all, test_string: nil)
  @url = url
  @file = file
  @header_set = file.nil? ? header_set : :file
  @test_string = test_string

  @headers = Concuss::Headers.new(header_set: @header_set, file: @file).group
end

Instance Attribute Details

#fileObject (readonly)

Returns the value of attribute file.



6
7
8
# File 'lib/concuss.rb', line 6

def file
  @file
end

#header_setObject (readonly)

Returns the value of attribute header_set.



6
7
8
# File 'lib/concuss.rb', line 6

def header_set
  @header_set
end

#headersObject (readonly)

Returns the value of attribute headers.



6
7
8
# File 'lib/concuss.rb', line 6

def headers
  @headers
end

#test_stringObject (readonly)

Returns the value of attribute test_string.



6
7
8
# File 'lib/concuss.rb', line 6

def test_string
  @test_string
end

#urlObject (readonly)

Returns the value of attribute url.



6
7
8
# File 'lib/concuss.rb', line 6

def url
  @url
end

Instance Method Details

#attack!Object



17
18
19
20
21
# File 'lib/concuss.rb', line 17

def attack!
  runner = Concuss::Runner.new(headers: headers, url: url, test_string: test_string)

  runner.run
end