Class: ESV::ReadingPlan

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/esv/reading_plan.rb

Instance Method Summary collapse

Constructor Details

#initialize(default_options = {}) ⇒ ReadingPlan

The ESV API requires a key that can be passed in as one of the options, :key => ‘value’. By default, it is ‘IP’



10
11
12
13
# File 'lib/esv/reading_plan.rb', line 10

def initialize(default_options={})
  @default_options = default_options
  @default_options[:key] ||= 'IP'
end

Instance Method Details

#info(options = {}) ⇒ Object

Parse and display information about the reading plan for a given date

See www.esvapi.org/api for more information and options



25
26
27
# File 'lib/esv/reading_plan.rb', line 25

def info(options={})
  self.class.get '/readingPlanInfo', :query => @default_options.merge(options)
end

#query(options = {}) ⇒ Object

Retrieve passages from our Devotions section

See www.esvapi.org/api for more information and options



18
19
20
# File 'lib/esv/reading_plan.rb', line 18

def query(options={})
  self.class.get '/readingPlanQuery', :query => @default_options.merge(options)
end