class Mumukit::Bridge::Bibliotheca

Attributes

url[RW]

Public Class Methods

new(url) click to toggle source
# File lib/mumukit/bridge/bibliotheca.rb, line 6
def initialize(url)
  @url = url
end

Public Instance Methods

book(slug) click to toggle source
# File lib/mumukit/bridge/bibliotheca.rb, line 30
def book(slug)
  get_element 'books', slug
end
books() click to toggle source
# File lib/mumukit/bridge/bibliotheca.rb, line 18
def books
  get_collection 'books'
end
get(path) click to toggle source
# File lib/mumukit/bridge/bibliotheca.rb, line 42
def get(path)
  JSON.parse RestClient.get("#{url}/#{path}")
end
get_collection(name) click to toggle source
# File lib/mumukit/bridge/bibliotheca.rb, line 34
def get_collection(name)
  get(name)[name]
end
get_element(name, slug) click to toggle source
# File lib/mumukit/bridge/bibliotheca.rb, line 38
def get_element(name, slug)
  get "#{name}/#{slug}"
end
guide(slug) click to toggle source
# File lib/mumukit/bridge/bibliotheca.rb, line 22
def guide(slug)
  get_element 'guides', slug
end
guides() click to toggle source
# File lib/mumukit/bridge/bibliotheca.rb, line 10
def guides
  get_collection 'guides'
end
topic(slug) click to toggle source
# File lib/mumukit/bridge/bibliotheca.rb, line 26
def topic(slug)
  get_element 'topics', slug
end
topics() click to toggle source
# File lib/mumukit/bridge/bibliotheca.rb, line 14
def topics
  get_collection 'topics'
end