package io.github.tobyhs.weatherweight.forecast;

import javax.inject.Inject;

import com.hannesdorfmann.mosby.mvp.MvpBasePresenter;

import io.github.tobyhs.weatherweight.util.SchedulerProvider;
import io.github.tobyhs.weatherweight.yahooweather.WeatherRepository;

/**
 * Presenter for the forecast activity
 */
public class ForecastPresenter extends MvpBasePresenter<ForecastContract.View> {
    private String attributionUrl;
    private final SchedulerProvider schedulerProvider;
    private final WeatherRepository weatherRepository;

    /**
     * @param schedulerProvider RX scheduler provider
     * @param weatherRepository weather repository object to obtain forecast data
     */
    @Inject
    public ForecastPresenter(SchedulerProvider schedulerProvider, WeatherRepository weatherRepository) {
        attributionUrl = WeatherRepository.ATTRIBUTION_URL;
        this.schedulerProvider = schedulerProvider;
        this.weatherRepository = weatherRepository;
    }

    /**
     * @return attribution URL to link to
     */
    public String getAttributionUrl() {
        return attributionUrl;
    }
}

@@ -258,16 +258,82 @@
 ository;
+%0Aimport io.github.tobyhs.weatherweight.yahooweather.model.Channel;
 %0A%0A/**%0A *
@@ -470,28 +470,22 @@
 ate 
-String attributionUr
+Channel channe
 l;%0A 
@@ -867,68 +867,8 @@
 ) %7B%0A
-        attributionUrl = WeatherRepository.ATTRIBUTION_URL;%0A
     
@@ -1001,113 +1001,376 @@
 urn 
-attribution URL to link to%0A     */%0A    public String getAttributionUrl() %7B%0A        return attributionUrl;
+object with the forecast data we are presenting%0A     */%0A    public Channel getChannel() %7B%0A        return channel;%0A    %7D%0A%0A    /**%0A     * @return attribution URL to link to%0A     */%0A    public String getAttributionUrl() %7B%0A        if (channel == null) %7B%0A            return WeatherRepository.ATTRIBUTION_URL;%0A        %7D else %7B%0A            return channel.getLink();%0A        %7D
 %0A   

Implement ForecastPresenter.getChannel