Module: Scriptura::Scripture

Defined in:
lib/scriptura/scripture.rb

Constant Summary collapse

HOME_PATH =
File.realpath(File.join(File.dirname(__FILE__), '..', '..'))
METADATA_FILE =
File.join(HOME_PATH, 'lib', 'scriptura', 'metadata.yml')

Class Method Summary collapse

Class Method Details

.book_namesObject



28
29
30
# File 'lib/scriptura/scripture.rb', line 28

def self.book_names
  books.map(&:name)
end

.booksObject



24
25
26
# File 'lib/scriptura/scripture.rb', line 24

def self.books
  old_testament_books + new_testament_books
end

.find_book_hash(attribute, value) ⇒ Object



36
37
38
# File 'lib/scriptura/scripture.rb', line 36

def self.find_book_hash attribute, value
  .values.find { |book| book[attribute.to_s] == value }
end

.metadataObject



32
33
34
# File 'lib/scriptura/scripture.rb', line 32

def self.
  @metadata ||= YAML.load_file(METADATA_FILE)
end

.new_testament_booksObject



16
17
18
19
20
21
22
# File 'lib/scriptura/scripture.rb', line 16

def self.new_testament_books
  books = []
  (40..66).each do |book_number|
    books << ScriptureBook.new(book_number)
  end
  books
end

.old_testament_booksObject



8
9
10
11
12
13
14
# File 'lib/scriptura/scripture.rb', line 8

def self.old_testament_books
  books = []
  (1..39).each do |book_number|
    books << ScriptureBook.new(book_number)
  end
  books
end