/tutorial/get_text/library/library.e

http://github.com/tybor/Liberty · Specman e · 34 lines · 28 code · 6 blank · 0 comment · 0 complexity · 1277612bbc0924f8a7909e0ad07f02ca MD5 · raw file

  1. class LIBRARY
  2. creation {ANY}
  3. make
  4. feature {ANY}
  5. print_hello is
  6. do
  7. io.put_string(translator.translation("Hello from the library"))
  8. io.put_new_line
  9. end
  10. feature {}
  11. make (translator_: GET_TEXT[STRING]) is
  12. require
  13. translator_ /= Void
  14. local
  15. library_translator: LIBRARY_TRANSLATOR
  16. do
  17. create library_translator.connect_to(translator_)
  18. translator_reference.set_item(library_translator)
  19. end
  20. translator: LIBRARY_TRANSLATOR is
  21. do
  22. Result := translator_reference.item
  23. end
  24. translator_reference: REFERENCE[LIBRARY_TRANSLATOR] is
  25. once
  26. create Result
  27. end
  28. end -- class LIBRARY