Class: LintTrap::Language::Base
- Inherits:
-
Object
- Object
- LintTrap::Language::Base
- Defined in:
- lib/lint_trap/language/base.rb
Overview
Interface for languages
Direct Known Subclasses
CPP, CSS, CoffeeScript, Go, JSON, Java, JavaScript, Python, Ruby, SCSS, Unknown
Instance Attribute Summary collapse
-
#linters ⇒ Object
readonly
Returns the value of attribute linters.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #add_linter(linter) ⇒ Object
-
#initialize ⇒ Base
constructor
A new instance of Base.
- #inspect ⇒ Object
- #name ⇒ Object
Constructor Details
#initialize ⇒ Base
Returns a new instance of Base.
7 8 9 |
# File 'lib/lint_trap/language/base.rb', line 7 def initialize @linters = [] end |
Instance Attribute Details
#linters ⇒ Object (readonly)
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 |