package pdf

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 (p *Generator) Update() {
	commoditiesNews := p.manager.GetCommoditiesNews()
	fmt.Println("--- PDF start ---")
	for _, news := range commoditiesNews {
		fmt.Printf("%+v\n", news.Content())
	}
	fmt.Println("--- PDF  end  ---")
}
