Class: Fitting::Report::Prefixes

Inherits:
Object
  • Object
show all
Defined in:
lib/fitting/report/prefixes.rb

Instance Method Summary collapse

Constructor Details

#initialize(configuration_prefixes) ⇒ Prefixes

Returns a new instance of Prefixes.



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/fitting/report/prefixes.rb', line 6

def initialize(configuration_prefixes)
  @prefixes = []

  configuration_prefixes.map do |prefix|
    @prefixes.push(
      Fitting::Report::Prefix.new(
        schema_paths: prefix['schema_paths'],
        type: prefix['type'],
        name: prefix['name'],
        skip: prefix['skip'],
        only: prefix['only']
      )
    )
  end
end

Instance Method Details

#find!(test) ⇒ Object



26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/fitting/report/prefixes.rb', line 26

def find!(test)
  @prefixes.map do |prefix|
    puts test.path
    puts test.host
    puts test.method
    puts test.status
    puts test.body
    puts prefix.name
    if test.path[0..prefix.name.size - 1] == prefix.name
      return prefix
    end
  end
end

#to_aObject



22
23
24
# File 'lib/fitting/report/prefixes.rb', line 22

def to_a
  @prefixes
end