class Alquran::Ayah

Public Class Methods

fetch(options) click to toggle source
# File lib/alquran/ayah.rb, line 4
def fetch(options)
  Api::Client.fetch(filter_options(**options))
end

Private Class Methods

filter_options(options) click to toggle source
# File lib/alquran/ayah.rb, line 14
def filter_options(options)
  return show_options(**options) unless options.has_key?(:sajdah)

  action_option = { action: :sajdah }

  edition_option = { edition: options[:edition] }.compact

  options.slice(:number).merge(self.entity_option).merge(action_option).merge(extras: edition_option)
end
show_options(options) click to toggle source
# File lib/alquran/ayah.rb, line 9
def show_options(options)
  edition_option = { edition: options[:edition] }.compact
  options.slice(:number).merge(self.entity_option).merge(action: :show).merge(extras: edition_option)
end