Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

betterplace-bi

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

betterplace-bi

  • 0.7.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Betterplace-BI

Description

This library transfers BI data from an application to a BIME-server.

Configuration

Via a config/bi.yml file in YAML like so:

---
production:
  update: yes
  auth:
    username: bi
    password: secret
  clear: http://localhost:1234/api/v1/all/:id
  endpoints:
    BI::TestModelValue:
      POST: http://localhost:1234/api/v1/tests
      DELETE: http://localhost:1234/api/v1/test/:id
  bime_dir:
    <%= Pathname.pwd.join('../bime') %>

Usage

For every Rails model TestModel define a class named BI::TestModelValue like this:

class BI::TestModelValue
  include BI::SharedValue

  def self.update_class
    ::TestModel
  end

  field type: 'string', db: 'gorm:"type:uuid;primary_key"'
  def id
    @object.id
  end

  field type: '*int64', db: 'gorm:"type:bigint"'
  def number
    10 ** 10
  end

  field type: '*time.Time', db: bp_timestamp # ISO timestamp string, e. g. "2018-11-05T15:40:14.362219+01:00"
  def created_at
    iso_timestamp(@object.created_at)
  end
end

Compute the values to be transfered by accessing @object and define GO types and GORM struct tags for these values.

Also include BI::Updater in TestModel like so:

class TestModel < ApplicationRecord
  include BI::Updater

  has_one :dependent

  def trigger_dependent_updates
    dependent.schedule_bi_update_job(true)
  end
end

License

This software is licensed under the Apache 2.0 license.

FAQs

Package last updated on 08 Apr 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc