UNPKG

@trusthab/composable-resources

Version:

migrating https://github.com/knetikmedia/hab-api/tree/integration/app/resources/composable

30 lines (22 loc) 490 B
const composer = require('../../mixin_loader'); module.exports = (App) => { const { underscore } = require('inflected'); class DevicesTotalResource { static mixins() { return ['Kpi']; } getMetricId() { return 'devices_total'; } getMetricType() { return 'gauge'; } getValue() { if (this.get('obj').device_type !== 'gateway') { return 1; } return 0; } } return composer(DevicesTotalResource, App); };