Project

scriptura

0.0
No commit activity in last 3 years
No release in over 3 years
There's a lot of open issues
A ruby library that attempts to provide an intuitive API for operations on meta information about the Bible
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 0

Runtime

 Project Readme

Gem Version Circle CI Code Climate Test Coverage Dependency Status

This is a ruby library that provides operations related with meta information about the Bible

Installation

Add this line to your application's Gemfile:

gem 'scriptura'

And then execute:

$ bundle

Or install it yourself as:

$ gem install scriptura

Usage

There are four main classes in this library:

  • Scripture
  • ScriptureBook
  • ScriptureChapter
  • ScriptureVerse
  • ScriptureReference

###Scripture

The way it is written, this is actually a module that encapsulates methods that scope the entire bible

> Scripture.book_names
 => ["Genesis", "Exodus", "Leviticus", ... , "Revelation"]

###ScriptureBook

This is a ruby class that gets initialized by passing in the book number. You can also find_by_name the book or find it by its 'string_id'

Note: Books with no chapters are considered to be books with one chapter

> sb = ScriptureBook.new(1)
 => #<ScriptureBook:0x007fcb1b80f7f8 @number=1>
> sb.name
  => "Genesis"
> ScriptureBook.find_by_name("1 Corinthians")
 => #<ScriptureBook:0x007fa194831e80 @number=46>
> ScriptureBook.find_by_name("1 Corinthians").number
 => 46
> ScriptureBook.find("1-corinthians")
 => #<ScriptureBook:0x007fa195866378 @number=46>
> ScriptureBook.find("1-corinthians").number
 => 46
> ScriptureBook.find("1-corinthians").number_of_chapters
 => 16

It raises an error when trying to initalize a scripture book that doesn't exist

> ScriptureBook.new(67)
RuntimeError: book number should be within 1-66
.
.

Feel free to browse the code / test to get a sense of the API