Class: MeteoPl::Utility::Presenter
- Inherits:
-
Object
- Object
- MeteoPl::Utility::Presenter
- Defined in:
- lib/meteo_pl/utility/presenter.rb
Instance Method Summary collapse
-
#initialize(net_fetcher, file_handler, file_opener, graph) ⇒ Presenter
constructor
A new instance of Presenter.
- #show ⇒ Object
Constructor Details
#initialize(net_fetcher, file_handler, file_opener, graph) ⇒ Presenter
Returns a new instance of Presenter.
4 5 6 7 8 9 |
# File 'lib/meteo_pl/utility/presenter.rb', line 4 def initialize(net_fetcher, file_handler, file_opener, graph) @net_fetcher = net_fetcher @file_handler = file_handler @file_opener = file_opener @graph = graph end |
Instance Method Details
#show ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/meteo_pl/utility/presenter.rb', line 11 def show file_handler.open do |temp_file| graph_content = net_fetcher.fetch(graph.uri, &:body) temp_file.write(graph_content) file_opener.path = temp_file.path file_opener.open end end |