class Mumuki::Domain::Store::Bibliotheca

This Store enables importing content from Bibliotheca API

Public Class Methods

new(bibliotheca_bridge) click to toggle source
# File lib/mumuki/domain/store/bibliotheca.rb, line 9
def initialize(bibliotheca_bridge)
  @bibliotheca_bridge = bibliotheca_bridge
end

Public Instance Methods

do_read(sync_key) click to toggle source
# File lib/mumuki/domain/store/bibliotheca.rb, line 21
def do_read(sync_key)
  @bibliotheca_bridge.send(sync_key.kind.as_variable_name, sync_key.id)
end
sync_keys() click to toggle source
# File lib/mumuki/domain/store/bibliotheca.rb, line 13
def sync_keys
  %w(guide topic book).flat_map do |kind|
    @bibliotheca_bridge
      .send(kind.as_variable_name.pluralize)
      .map { |it| Mumukit::Sync.key kind, it['slug']  }
  end
end
write_resource!(*) click to toggle source
# File lib/mumuki/domain/store/bibliotheca.rb, line 25
def write_resource!(*)
  Mumukit::Sync::Store.read_only!
end