18F/e-QIP-prototype

View on GitHub
api/height.go

Summary

Maintainability
A
0 mins
Test Coverage
package api

import "encoding/json"

// Height is a basic input.
type Height struct {
    ID     int `json:"-"`
    Feet   int `json:"feet"`
    Inches int `json:"inches"`
}

// Unmarshal bytes in to the entity properties.
func (entity *Height) Unmarshal(raw []byte) error {
    return json.Unmarshal(raw, entity)
}

// Marshal to payload structure
func (entity *Height) Marshal() Payload {
    return MarshalPayloadEntity("height", entity)
}