Class: Kamal::Lint::Registry

Inherits:
Object
  • Object
show all
Defined in:
lib/kamal/lint/registry.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeRegistry

Returns a new instance of Registry.



10
11
12
# File 'lib/kamal/lint/registry.rb', line 10

def initialize
  @checks = []
end

Class Method Details

.defaultObject



6
7
8
# File 'lib/kamal/lint/registry.rb', line 6

def self.default
  @default ||= new
end

Instance Method Details

#allObject



19
20
21
# File 'lib/kamal/lint/registry.rb', line 19

def all
  @checks.dup
end

#applicable_to(kamal_version) ⇒ Object



23
24
25
# File 'lib/kamal/lint/registry.rb', line 23

def applicable_to(kamal_version)
  @checks.select { |c| c.applies_to?(kamal_version) }
end

#find(id) ⇒ Object



27
28
29
# File 'lib/kamal/lint/registry.rb', line 27

def find(id)
  @checks.find { |c| c.id == id }
end

#register(check_class) ⇒ Object



14
15
16
17
# File 'lib/kamal/lint/registry.rb', line 14

def register(check_class)
  @checks << check_class unless @checks.include?(check_class)
  check_class
end