github.com/franciscoadasme/views
master / published May 12, 2022 / repository
Views and wrappers for stdlib collections
Views
A collection of views and wrappers of collection types such as Array
and Hash.
A view is a read-only version of the corresponding type, e.g,
ArrayView gives access to an Array.
A wrapper is like a view, but the methods returning the same type
instead will return a wrapped value, e.g., ArrayWrapper#select method
will return an ArrayWrapper instead of an Array. There are both
read-only and mutable variants of each wrapper, e.g., ArrayWrapper and
ArrayWrapper::Mutable.
Installation
-
Add the dependency to your
shard.yml:dependencies: views: github: franciscoadasme/views -
Run
shards install
Usage
require "views"
TODO: Write usage instructions here
Development
TODO: Write development instructions here
Contributing
- Fork it (https://github.com/franciscoadasme/views/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- Francisco Adasme - creator and maintainer
API
- Array(T)
An
Arrayis an ordered, integer-indexed collection of objects of type T. - Hash(K, V)
A
Hashrepresents a collection of key-value mappings, similar to a dictionary. - Indexable(T)
A container that allows accessing elements via a numeric index.
- Wrapper(T)
Wraps an object such that methods are delegated to the wrapped object.