mumukit-bridge 1.0.1 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- OWI2ODI5ODg3M2NiM2YxNjIwMGQ5YTE3Y2M4NmMyNzA5NzAwOGYzMA==
4
+ YzlhMWNiYTI4NjUwMzI4OWM2YjY5ZjFkMTNkZTBhMzMxZjI2ZjJjZg==
5
5
  data.tar.gz: !binary |-
6
- NzQyMDY0N2EzZDdmNThhZWNhZGQ1ZWY4NmUyZDI0MGI3YzJkNWQ3Nw==
6
+ ZTAyZjk1ODYxY2EwMDY0ZWQyMmJiNmUyMWJlOGZlOGM4NGVjMjBlZg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MGVkODRjNjcxY2U0OTRkYmQ1OThkZDZkZDc2NjEwODJjZmRiMTdlNDhhNjVi
10
- YjhkMDllNTkxODkzY2NmNzI1MWM3ZWI3MzA2YmYwYzJiZWMxODRmMjhiMDA5
11
- OTk4ODQ3YjNlNmY3NzE5ZDBmZGYwZTNjNzMzZTk5ZjVmZDIxOTM=
9
+ M2YyZjFkOTIxMjM5ODI1Njc2MDZmNjU0MDc2NGY2MmNkZGIzNTMyOWEwZjYy
10
+ OGY3OGI1MTI1NzkxNDM3ZjQ4YjAyMDBkMTMwMzE2ZDZlZTIyNmM3YWRhMmZj
11
+ MmZmYjMxMzZkYTNiY2EwNzhiNWRjZDRjNjIzN2FiNzY5ZGVlMTg=
12
12
  data.tar.gz: !binary |-
13
- ODU4OGI4OTFlMWM4Mzg5MmRmNzgwNzQzNDQ3NzZjNWI1ODBmMjMzODU1MGJm
14
- YTMwNzdlYjEyNmM2MmQ1MWYxNDI3ZjU1Yjk3OTIyNzAwYjU3YzQ4ZGU1NzI3
15
- YjAzNDVkNzRkNzkxNGE3NTJiMGVlYmExOTdhNTlmZTI0OGVlMmQ=
13
+ MGI1NzllN2Y2ZmI0ZjI1OTg2NWJhMTEzNTc2ZTliOThhZGNjNTdmZjIwYzc0
14
+ NmNjZDMzYTg4ZWY1ZmJmNzEzMmEyYTM3OGYwN2E5MTlmNTMxMWE3OTQ0MmM4
15
+ ZDUwYTJkYzdmMWYxMTkzMzg5ZTNhMmI5NmJlZDUxZmZjYjljNjA=
@@ -8,19 +8,35 @@ module Mumukit
8
8
  end
9
9
 
10
10
  def guides
11
- get('guides')['guides']
11
+ get_collection 'guides'
12
+ end
13
+
14
+ def topics
15
+ get_collection 'topics'
12
16
  end
13
17
 
14
18
  def books
15
- get('books')['books']
19
+ get_collection 'books'
16
20
  end
17
21
 
18
22
  def guide(slug)
19
- get "guides/#{slug}"
23
+ get_element 'guides', slug
24
+ end
25
+
26
+ def topic(slug)
27
+ get_element 'topics', slug
20
28
  end
21
29
 
22
30
  def book(slug)
23
- get "books/#{slug}"
31
+ get_element 'books', slug
32
+ end
33
+
34
+ def get_collection(name)
35
+ get(name)[name]
36
+ end
37
+
38
+ def get_element(name, slug)
39
+ get "#{name}/#{slug}"
24
40
  end
25
41
 
26
42
  def get(path)
@@ -5,14 +5,15 @@ module Mumukit
5
5
 
6
6
  def initialize(url = 'http://bibliotheca.mumuki.io')
7
7
  @url = url
8
+ @language = {}
8
9
  end
9
10
 
10
11
  def languages
11
- get('languages')['languages']
12
+ @languages ||= get('languages')['languages']
12
13
  end
13
14
 
14
15
  def language(name)
15
- get "languages/#{name}"
16
+ @language[name] ||= get "languages/#{name}"
16
17
  end
17
18
 
18
19
  def get(path)
@@ -1,5 +1,5 @@
1
1
  module Mumukit
2
2
  module Bridge
3
- VERSION = '1.0.1'
3
+ VERSION = '1.1.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mumukit-bridge
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Franco Leonardo Bulgarelli
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-04 00:00:00.000000000 Z
11
+ date: 2016-05-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler