Skip to content

Latest commit

 

History

History
58 lines (36 loc) · 1.95 KB

README.md

File metadata and controls

58 lines (36 loc) · 1.95 KB

Version      Build Status Code Climate Test Coverage Dependencies

ActiveRegistry

Provides a data structure for collecting homogeneous objects and indexing them for quick lookup.

Requirements

Ruby 2.3+

Installation

Add this line to your application's Gemfile:

gem 'active_registry'

And then execute:

$ bundle

Or install it yourself as:

$ gem install active_registry

Usage

  Person = Struct.new(:id, :name, :email)

  registry = ActiveRegistry.new([
    Person.new(1, 'Dale', 'jason@twilightcoders.net'),
    Person.new(2, 'Dale', 'dale@twilightcoders.net')
  ])

  registry.index(:name)

  d = registry[:name, 'Dale'].first
  d.name = "Jason"

  registry.find(:name, 'Jason')

Development

After checking out the repo, run bundle to install dependencies. Then, run bundle exec rspec to run the tests.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/TwilightCoders/active_registry. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.