Class: ApiTester::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/api-tester/config.rb

Overview

Config class for changing how the tool operates

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(reporter: ApiTester::ApiReport.new) ⇒ Config

Returns a new instance of Config.



10
11
12
13
# File 'lib/api-tester/config.rb', line 10

def initialize(reporter: ApiTester::ApiReport.new)
  self.reporter = reporter
  self.modules = []
end

Instance Attribute Details

#modulesObject

Returns the value of attribute modules.



8
9
10
# File 'lib/api-tester/config.rb', line 8

def modules
  @modules
end

#reporterObject

Returns the value of attribute reporter.



8
9
10
# File 'lib/api-tester/config.rb', line 8

def reporter
  @reporter
end

Instance Method Details

#with_all_modulesObject



33
34
35
36
37
38
39
40
# File 'lib/api-tester/config.rb', line 33

def with_all_modules
  modules << Format
  modules << ExtraVerbs
  modules << GoodCase
  modules << Typo
  modules << UnusedFields
  self
end

#with_default_modulesObject



25
26
27
28
29
30
31
# File 'lib/api-tester/config.rb', line 25

def with_default_modules
  modules << Format
  modules << GoodCase
  modules << Typo
  modules << UnusedFields
  self
end

#with_module(new_module) ⇒ Object



20
21
22
23
# File 'lib/api-tester/config.rb', line 20

def with_module(new_module)
  modules << new_module
  self
end

#with_reporter(reporter) ⇒ Object



15
16
17
18
# File 'lib/api-tester/config.rb', line 15

def with_reporter(reporter)
  self.reporter = reporter
  self
end