Class: Votd::BibleGateway

Inherits:
Base
  • Object
show all
Defined in:
lib/votd/bible_gateway.rb

Overview

Retrieves a Verse of the Day from biblegateway.com using a variety of translations.

Default translation is NIV (New International Version)

docs: www.biblegateway.com/usage/votd/docs/

version list: www.biblegateway.com/usage/linking/versionslist.php

Constant Summary collapse

BIBLE_VERSIONS =

These are the English translations that are copyright-approved for Bible Gateway VotD as of November 2019.

{
  amp:      { name: 'Amplified Bible',                     id: 45 },
  asv:      { name: 'American Standard Version',           id: 8 },
  ceb:      { name: 'Common English Bible',                id: 105 },
  darby:    { name: 'Darby Translation',                   id: 16 },
  esv:      { name: 'English Standard Version',            id: 47 },
  esvu:     { name: 'English Standard Version Anglicised', id: 166 },
  gw:       { name: "God's Word Translation",              id: 158 },
  hcsb:     { name: 'Holman Christian Standard Bible',     id: 77 },
  kjv:      { name: 'King James Version',                  id: 9 },
  leb:      { name: 'Lexham English Bible',                id: 165 },
  nasb:     { name: 'New American Standard Bible',         id: 49 },
  nirv:     { name: "New International Reader's Version",  id: 76 },
  niv:      { name: 'New International Version',           id: 31 },
  nivuk:    { name: 'New International Version - UK',      id: 64 },
  nlt:      { name: 'New Living Translation',              id: 51 },
  nlv:      { name: 'New Life Version',                    id: 74 },
  phillips: { name: 'J.B. Phillips New Testament',         id: 164 },
  we:       { name: 'Worldwide English (New Testament)',   id: 73 },
  wyc:      { name: 'Wycliffe Bible',                      id: 53 },
  ylt:      { name: "Young's Literal Translation",         id: 15 }
}
URI =

The URI of the API gateway

"http://www.biblegateway.com/usage/votd/rss/votd.rdf?"
/(Brought to you by BibleGateway.*$)/

Constants inherited from Base

Votd::Base::DEFAULT_BIBLE_REFERENCE, Votd::Base::DEFAULT_BIBLE_TEXT, Votd::Base::DEFAULT_BIBLE_VERSION, Votd::Base::DEFAULT_BIBLE_VERSION_NAME, Votd::Base::DEFAULT_LINK

Instance Attribute Summary

Attributes inherited from Base

#copyright, #date, #link, #reference, #text, #version, #version_name

Instance Method Summary collapse

Methods inherited from Base

#custom_html, #custom_text, #to_html, #to_text

Constructor Details

#initialize(version = :niv) ⇒ BibleGateway

Initializes the BibleGateway class



48
49
50
51
52
53
54
55
# File 'lib/votd/bible_gateway.rb', line 48

def initialize(version = :niv)
  raise InvalidBibleVersion unless BIBLE_VERSIONS.has_key?(version)

  @version = version.to_s.upcase
  @version_number = BIBLE_VERSIONS[version][:id]
  @version_name = BIBLE_VERSIONS[version][:name]
  super()
end