Advertisement
Guest User

Untitled

a guest
Apr 24th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. # abstract
  2. module Interface
  3. class Adapter
  4. def required_behavior(data, args)
  5. raise NotImplementedError, 'Must be implemented by child class!'
  6. end
  7. end
  8. end
  9.  
  10. # concrete
  11. module Interface
  12. class SpecificAdapter < Adapter
  13. def required_behavior(data, args)
  14. data.each { |record| specific_behavior(record, args) }
  15. end
  16.  
  17. private
  18.  
  19. def specific_behavior(record, args)
  20. # do stuff to a record with the provided args
  21. end
  22. end
  23. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement