Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Linter
- def lint
- raise NotImplementedError, 'uuhh Oh!, you forgot to implement lint method!'
- end
- end
- class JsonLinter < Linter
- def lint(file)
- # code to lint the json file
- puts "linting #{file}"
- end
- end
- class RubyLinter < Linter
- def lint(file)
- # code to lint the Ruby file
- puts "linting #{file}"
- end
- end
- JsonLinter.new.lint(file)
- # outputs the lint Json file
- RubyLinter.new.lint(file)
- # outputs the lint Ruby file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement