Class: LintTrap::Language::Base
- Inherits:
-
Object
- Object
- LintTrap::Language::Base
show all
- Defined in:
- lib/lint_trap/language/base.rb
Overview
Direct Known Subclasses
CPP, CSS, CoffeeScript, Go, JSON, Java, JavaScript, Python, Ruby, SCSS, Unknown
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize ⇒ Base
7
8
9
|
# File 'lib/lint_trap/language/base.rb', line 7
def initialize
@linters = []
end
|
Instance Attribute Details
#linters ⇒ Object
Returns the value of attribute linters.
5
6
7
|
# File 'lib/lint_trap/language/base.rb', line 5
def linters
@linters
end
|
Instance Method Details
#==(other) ⇒ Object
19
20
21
22
23
|
# File 'lib/lint_trap/language/base.rb', line 19
def ==(other)
return false unless other.respond_to?(:name, true)
name == other.name
end
|
#add_linter(linter) ⇒ Object
15
16
17
|
# File 'lib/lint_trap/language/base.rb', line 15
def add_linter(linter)
@linters << linter
end
|
#inspect ⇒ Object
25
26
27
|
# File 'lib/lint_trap/language/base.rb', line 25
def inspect
"<#{name}>"
end
|
#name ⇒ Object
11
12
13
|
# File 'lib/lint_trap/language/base.rb', line 11
def name
self.class.name.split('::').last
end
|