factory_method

package
v0.0.0-...-6e5d4c6 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2019 License: MIT Imports: 2 Imported by: 0

README

Factory Method

Documentation

Index

Constants

View Source
const (
	Cash = iota
	DebitCard
	CreditCard
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CashPM

type CashPM struct{}

func (*CashPM) Pay

func (c *CashPM) Pay(amount float32) string

type CreditCardPM

type CreditCardPM struct{}

func (*CreditCardPM) Pay

func (d *CreditCardPM) Pay(amount float32) string

type DebitCardPM

type DebitCardPM struct{}

func (*DebitCardPM) Pay

func (c *DebitCardPM) Pay(amount float32) string

type PaymentMethod

type PaymentMethod interface {
	Pay(amount float32) string
}

func GetPaymentMethod

func GetPaymentMethod(m int) (PaymentMethod, error)

Jump to

Keyboard shortcuts

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