Class: Votd::BibleGateway
- Inherits:
-
Base
- Object
- Base
- Votd::BibleGateway
- 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).
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} }
- ENDPOINT_URL =
The URL of the API gateway
"https://www.biblegateway.com/usage/votd/rss/votd.rdf?"- COPYRIGHT_TEXT_REGEX =
Regular expression for pulling the copyright out of the Bible text
/(Brought to you by BibleGateway.*$)/
Instance Method Summary collapse
-
#initialize(version = :niv) ⇒ BibleGateway
constructor
Initializes the BibleGateway class and fetches the verse of the day.
Constructor Details
#initialize(version = :niv) ⇒ BibleGateway
Initializes the BibleGateway class and fetches the verse of the day.
58 59 60 61 62 63 64 65 |
# File 'lib/votd/bible_gateway.rb', line 58 def initialize(version = :niv) raise InvalidBibleVersion unless BIBLE_VERSIONS.key?(version) @version = version.to_s.upcase @version_number = BIBLE_VERSIONS[version][:id] @version_name = BIBLE_VERSIONS[version][:name] super() end |