Class: CodelessCode::Filters::Lang

Inherits:
Object
  • Object
show all
Defined in:
lib/codeless_code/filters/lang.rb

Overview

Matches fables in the given language (code).

Instance Method Summary collapse

Constructor Details

#initialize(exact: nil) ⇒ Lang

Returns a new instance of Lang.


22
23
24
# File 'lib/codeless_code/filters/lang.rb', line 22

def initialize(exact: nil)
  @exact = exact
end

Instance Method Details

#call(fable) ⇒ Object


30
31
32
# File 'lib/codeless_code/filters/lang.rb', line 30

def call(fable)
  @exact.nil? || @exact == fable.lang
end

#enabled?Boolean

Returns:

  • (Boolean)

26
27
28
# File 'lib/codeless_code/filters/lang.rb', line 26

def enabled?
  @exact
end