toy

package
v0.0.0-...-8d8d9e6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 25, 2016 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package toy contains support for managing toy inventory.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Toy

type Toy struct {
	Name   string
	Weight int
	// contains filtered or unexported fields
}

Toy represents a toy we sell.

func New

func New(name string, weight int) *Toy

New creates values of type toy.

func (*Toy) OnHand

func (t *Toy) OnHand() int

OnHand returns the current number of this toy on hand.

func (*Toy) Sold

func (t *Toy) Sold() int

Sold returns the current number of this toy sold.

func (*Toy) UpdateOnHand

func (t *Toy) UpdateOnHand(count int) int

UpdateOnHand updates the on hand count and returns the current value.

func (*Toy) UpdateSold

func (t *Toy) UpdateSold(count int) int

UpdateSold updates the sold count and returns the current value.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL