Class: ThemeCheck::Checks

Inherits:
Array
  • Object
show all
Defined in:
lib/theme_check/checks.rb

Instance Method Summary collapse

Instance Method Details

#always_enabledObject



12
13
14
# File 'lib/theme_check/checks.rb', line 12

def always_enabled
  self.class.new(reject(&:can_disable?))
end

#call(method, *args) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/theme_check/checks.rb', line 4

def call(method, *args)
  each do |check|
    if check.respond_to?(method) && !check.ignored?
      check.send(method, *args)
    end
  end
end

#except_for(disabled_checks) ⇒ Object



16
17
18
19
20
# File 'lib/theme_check/checks.rb', line 16

def except_for(disabled_checks)
  still_enabled = reject { |check| disabled_checks.all.include?(check.code_name) }

  self.class.new((always_enabled + still_enabled).uniq)
end