package riceres

import (
	"io"

	rice "github.com/GeertJohan/go.rice"
	"opslag.de/schobers/zntg/ui"
)

type riceResources struct {
	*rice.Box
}

var _ ui.Resources = &riceResources{}

// New provides resources from a rice Box.
func New(box *rice.Box) ui.Resources {
	return &riceResources{box}
}

func (r *riceResources) Destroy() error { return nil }

func (r *riceResources) OpenResource(name string) (io.ReadCloser, error) { return r.Box.Open(name) }