package html

import (
	"fmt"
	"golang.source-fellows.com/pattern/observer/internal"
)

type Generator struct {
	manager *internal.CommoditiesNewsManager
}

func NewGenerator(manager *internal.CommoditiesNewsManager) *Generator {
	return &Generator{manager: manager}
}
func (c *Generator) Update() {
	commoditiesNews := c.manager.GetCommoditiesNews()
	fmt.Println("--- HTML start ---")
	for _, news := range commoditiesNews {
		fmt.Printf("%+v\n", news.Content())
	}
	fmt.Println("--- HTML  end  ---")
}
