Bibliography
A library of useful tools for books and related standards
Installation
Add this line to your application's Gemfile:
gem 'bibliography'
And then execute:
$ bundle
Or install it yourself as:
$ gem install bibliography
Usage
Currently, the library only offers BIC Subjects in a handy interface for traversing through parent and child subjects. This is accessible through:
Bibliography::BIC::Subjects
However, Bibliography also offers a convenience method for subjects, defaulting to BIC
Bibliography.subjects
# Alternatively, pass the symbol name of the standards body
Bibliography.subjects(:bic)
Subjects
To obtain a collection of all available subjects:
Bibliography.subjects.all # => [Bibliography::BIC::Subject, ...]
To select a specific subject by code:
subject = Bibliography.subjects.new('AB') # => Bibliography::BIC::Subject
A subject has two key properties, as declared by the BIC Subject standard:
subject.code # => 'AB'
subject.description # => 'The arts: general issues'
But the real usefulness of this library comes from the traversal methods:
subject.children? # => true
subject.children # => [Bibliography::BIC::Subject, ...]
subject.parent? # => true
subject.parent.code # => 'A'
Contributing
- Fork it
- 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 new Pull Request