Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. class Linter
  2. def lint
  3. raise NotImplementedError, 'uuhh Oh!, you forgot to implement lint method!'
  4. end
  5. end
  6.  
  7. class JsonLinter < Linter
  8. def lint(file)
  9. # code to lint the json file
  10. puts "linting #{file}"
  11. end
  12. end
  13.  
  14. class RubyLinter < Linter
  15. def lint(file)
  16. # code to lint the Ruby file
  17. puts "linting #{file}"
  18. end
  19. end
  20.  
  21. JsonLinter.new.lint(file)
  22. # outputs the lint Json file
  23.  
  24. RubyLinter.new.lint(file)
  25. # outputs the lint Ruby file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement