wanikani 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/wanikani/level.rb +7 -25
  3. metadata +18 -29
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: fdb10b6904c1bf800ba656c9a4588f8b59c985c1
4
+ data.tar.gz: f73c2e777be7096aa8b7c63a5749e9d54db3c260
5
+ SHA512:
6
+ metadata.gz: 2096e37debe5c3b3c30f67739bc24232a8af45242d17d30f4d0896d03697ec12ce8c5d9b1b880a89d09ce3e92426dd94c5687204908b4c811653196f90f63675
7
+ data.tar.gz: c1ad7001029833fd3d282a3206fc5b0b3157db048f94286f49d4915ee71c0dbaf092efe9faf14d07246b927cd38a435d495b09ad13ef4c3a273f3f7c79055327
@@ -6,36 +6,18 @@ module Wanikani
6
6
  # @return [Hash] Progress and total of radicals and Kanji for the user's current level.
7
7
  def self.progression
8
8
  api_response = Wanikani.api_response("level-progression")
9
- return api_response["requested_information"]
9
+ current_level = { "current_level" => api_response["user_information"]["level"] }
10
+ return api_response["requested_information"].merge(current_level)
10
11
  end
11
12
 
12
- # Gets the radicals for the specified levels.
13
- #
14
- # @param [Integer, Array] levels returns the list of radicals for one or more levels
15
- # @return [Array] Hashes with the radicals for the specified level(s).
16
- def self.radicals(levels = nil)
17
- levels = levels.join(',') if levels.is_a?(Array)
18
- api_response = Wanikani.api_response("radicals", levels)
19
- return api_response["requested_information"]
20
- end
13
+ private
21
14
 
22
- # Gets the Kanji for the specified levels.
23
- #
24
- # @param [Integer, Array] levels returns the list of Kanji for one or more levels
25
- # @return [Array] Hashes with the Kanji for the specified level(s).
26
- def self.kanji(levels = nil)
27
- levels = levels.join(',') if levels.is_a?(Array)
28
- api_response = Wanikani.api_response("kanji", levels)
29
- return api_response["requested_information"]
30
- end
15
+ def self.method_missing(name, *args)
16
+ super unless [:radicals, :kanji, :vocabulary].include?(name)
31
17
 
32
- # Gets the vocabulary for the specified levels.
33
- #
34
- # @param [Integer, Array] levels returns the list of vocabulary for one or more levels
35
- # @return [Array] Hashes with the vocabulary for the specified level(s).
36
- def self.vocabulary(levels = nil)
18
+ levels = args.push
37
19
  levels = levels.join(',') if levels.is_a?(Array)
38
- api_response = Wanikani.api_response("vocabulary", levels)
20
+ api_response = Wanikani.api_response(name.to_s, levels)
39
21
  return api_response["requested_information"]
40
22
  end
41
23
  end
metadata CHANGED
@@ -1,116 +1,105 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wanikani
3
3
  version: !ruby/object:Gem::Version
4
- prerelease:
5
- version: 0.0.3
4
+ version: 0.0.4
6
5
  platform: ruby
7
6
  authors:
8
7
  - Dennis Martinez
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-01-01 00:00:00.000000000 Z
11
+ date: 2013-05-22 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
- type: :runtime
14
+ name: rest-client
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ~>
20
18
  - !ruby/object:Gem::Version
21
19
  version: '1.6'
20
+ type: :runtime
22
21
  prerelease: false
23
22
  version_requirements: !ruby/object:Gem::Requirement
24
- none: false
25
23
  requirements:
26
24
  - - ~>
27
25
  - !ruby/object:Gem::Version
28
26
  version: '1.6'
29
- name: rest-client
30
27
  - !ruby/object:Gem::Dependency
31
- type: :runtime
28
+ name: multi_json
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
31
  - - ~>
36
32
  - !ruby/object:Gem::Version
37
33
  version: 1.5.0
34
+ type: :runtime
38
35
  prerelease: false
39
36
  version_requirements: !ruby/object:Gem::Requirement
40
- none: false
41
37
  requirements:
42
38
  - - ~>
43
39
  - !ruby/object:Gem::Version
44
40
  version: 1.5.0
45
- name: multi_json
46
41
  - !ruby/object:Gem::Dependency
47
- type: :development
42
+ name: rspec
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
45
  - - ~>
52
46
  - !ruby/object:Gem::Version
53
47
  version: '2.12'
48
+ type: :development
54
49
  prerelease: false
55
50
  version_requirements: !ruby/object:Gem::Requirement
56
- none: false
57
51
  requirements:
58
52
  - - ~>
59
53
  - !ruby/object:Gem::Version
60
54
  version: '2.12'
61
- name: rspec
62
55
  - !ruby/object:Gem::Dependency
63
- type: :development
56
+ name: fakeweb
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
59
  - - ~>
68
60
  - !ruby/object:Gem::Version
69
61
  version: 1.3.0
62
+ type: :development
70
63
  prerelease: false
71
64
  version_requirements: !ruby/object:Gem::Requirement
72
- none: false
73
65
  requirements:
74
66
  - - ~>
75
67
  - !ruby/object:Gem::Version
76
68
  version: 1.3.0
77
- name: fakeweb
78
69
  description: Use WaniKani's (http://www.wanikani.com/) API in your Ruby applications
79
70
  email: dennis@dennmart.com
80
71
  executables: []
81
72
  extensions: []
82
73
  extra_rdoc_files: []
83
74
  files:
84
- - lib/wanikani/study_queue.rb
85
- - lib/wanikani/recent_unlocks.rb
75
+ - lib/wanikani/level.rb
86
76
  - lib/wanikani/srs.rb
87
77
  - lib/wanikani/user.rb
88
- - lib/wanikani/level.rb
78
+ - lib/wanikani/study_queue.rb
89
79
  - lib/wanikani/critical_items.rb
80
+ - lib/wanikani/recent_unlocks.rb
90
81
  - lib/wanikani.rb
91
82
  homepage: http://github.com/dennmart/wanikani-gem
92
83
  licenses: []
84
+ metadata: {}
93
85
  post_install_message:
94
86
  rdoc_options: []
95
87
  require_paths:
96
88
  - lib
97
89
  required_ruby_version: !ruby/object:Gem::Requirement
98
- none: false
99
90
  requirements:
100
- - - ! '>='
91
+ - - '>='
101
92
  - !ruby/object:Gem::Version
102
93
  version: 1.9.2
103
94
  required_rubygems_version: !ruby/object:Gem::Requirement
104
- none: false
105
95
  requirements:
106
- - - ! '>='
96
+ - - '>='
107
97
  - !ruby/object:Gem::Version
108
98
  version: '0'
109
99
  requirements: []
110
100
  rubyforge_project:
111
- rubygems_version: 1.8.24
101
+ rubygems_version: 2.0.3
112
102
  signing_key:
113
- specification_version: 3
103
+ specification_version: 4
114
104
  summary: Add Japanese Kanji learning goodness to your Ruby projects!
115
105
  test_files: []
116
- has_rdoc: