<img src=“https://badge.fury.io/rb/institutions.png” alt=“Gem Version” /> <img src=“https://api.travis-ci.org/scotdalton/institutions.png?branch=master” alt=“Build Status” /> <img src=“https://gemnasium.com/scotdalton/institutions.png” alt=“Dependency Status” /> <img src=“https://codeclimate.com/github/scotdalton/institutions.png” /> <img src=“https://coveralls.io/repos/scotdalton/institutions/badge.png” alt=“Coverage Status” />

Institutions

This gem provides a mechanism for creating Institutions from a hash of Institutional data elements.

Institutions Basics

Getting institutions

Institutions reads in YAML files and creates a Hash of Institution instances with the Institution#code as the Hash key.

require 'institutions'
institutions = Institutions.institutions

Setting load paths

Specify additional directories to search for institutional YAMLs.

require 'institutions'
Institutions.loadpaths << File.join("path", "to", "new", "load", "directory")

Setting file name

Specify additional YAML file names that contain institutions.

require 'institutions'
Institutions.filenames << "my_institution.yml"

Institution attributes

Institutions have a number of attributes available, separated into logical modules

Core

code

String of unique code for the institution (required)

name

String of user friendly name for the institution (required)

default

Boolean indicating if this is a default institution

Auth

auth

Hash of attributes for an authentication/authorization system

Ip Addresses

ip_addresses

Array of ip addresses for the institution

MVC

models

Hash of attributes for models in an MVC application

views

Hash of attributes for views in an MVC application

controllers

Hash of attributes for controllers in an MVC application

Parents

parent_code

String of code representing the institution’s parent

Services

services

Hash of services for the given institution