Sha256: 088bd85a417ed049a87538bed84acfe16a71e4a5c3a9c0cefdfab629001f4c96

Contents?: true

Size: 760 Bytes

Versions: 95

Compression:

Stored size: 760 Bytes

Contents

module Mumuki::Domain::Store

  ## This Store enables importing content
  ## from Bibliotheca API
  class Bibliotheca < Mumukit::Sync::Store::Base
    include Mumukit::Sync::Store::WithWrappedLanguage
    include Mumukit::Sync::Store::WithFilteredId

    def initialize(bibliotheca_bridge)
      @bibliotheca_bridge = bibliotheca_bridge
    end

    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

    def do_read(sync_key)
      @bibliotheca_bridge.send(sync_key.kind.as_variable_name, sync_key.id)
    end

    def write_resource!(*)
      Mumukit::Sync::Store.read_only!
    end
  end
end

Version data entries

95 entries across 95 versions & 2 rubygems

Version Path
mumuki-domain-9.23.0 lib/mumuki/domain/store/bibliotheca.rb
mumuki-domain-9.22.1 lib/mumuki/domain/store/bibliotheca.rb
mumuki-domain-9.22.0 lib/mumuki/domain/store/bibliotheca.rb
mumuki-domain-9.21.0 lib/mumuki/domain/store/bibliotheca.rb
mumuki-domain-9.20.0 lib/mumuki/domain/store/bibliotheca.rb
mumuki-domain-9.19.0 lib/mumuki/domain/store/bibliotheca.rb
mumuki-domain-9.18.0 lib/mumuki/domain/store/bibliotheca.rb
mumuki-domain-9.17.0 lib/mumuki/domain/store/bibliotheca.rb
mumuki-domain-9.16.0 lib/mumuki/domain/store/bibliotheca.rb
mumuki-domain-9.15.0 lib/mumuki/domain/store/bibliotheca.rb
mumuki-domain-9.14.1 lib/mumuki/domain/store/bibliotheca.rb
mumuki-domain-9.14.0 lib/mumuki/domain/store/bibliotheca.rb
mumuki-domain-9.13.1 lib/mumuki/domain/store/bibliotheca.rb
mumuki-domain-9.13.0 lib/mumuki/domain/store/bibliotheca.rb
mumuki-domain-9.12.0 lib/mumuki/domain/store/bibliotheca.rb
mumuki-domain-9.11.0 lib/mumuki/domain/store/bibliotheca.rb
mumuki-domain-9.10.0 lib/mumuki/domain/store/bibliotheca.rb
mumuki-domain-9.9.0 lib/mumuki/domain/store/bibliotheca.rb
mumuki-domain-9.8.1 lib/mumuki/domain/store/bibliotheca.rb
mumuki-domain-9.8.0 lib/mumuki/domain/store/bibliotheca.rb