wanikani 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,14 @@
1
+ # -*- encoding : utf-8 -*-
2
+ module Wanikani
3
+ class CriticalItems
4
+ # Gets the user's current items under 'Critical Items'.
5
+ #
6
+ # @param [Integer] percentage maximum percentage
7
+ # @return [Array] Returns hashes of critical items and their related information.
8
+ def self.critical(percentage = 75)
9
+ raise ArgumentError, "Percentage must be an Integer between 0 and 100" if !percentage.between?(0, 100)
10
+ api_response = Wanikani.api_response("critical-items", percentage)
11
+ return api_response["requested_information"]
12
+ end
13
+ end
14
+ end
@@ -8,5 +8,35 @@ module Wanikani
8
8
  api_response = Wanikani.api_response("level-progression")
9
9
  return api_response["requested_information"]
10
10
  end
11
+
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
21
+
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
31
+
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)
37
+ levels = levels.join(',') if levels.is_a?(Array)
38
+ api_response = Wanikani.api_response("vocabulary", levels)
39
+ return api_response["requested_information"]
40
+ end
11
41
  end
12
42
  end
data/lib/wanikani.rb CHANGED
@@ -7,6 +7,10 @@ require 'wanikani/study_queue'
7
7
  require 'wanikani/level'
8
8
  require 'wanikani/srs'
9
9
  require 'wanikani/recent_unlocks'
10
+ require 'wanikani/critical_items'
11
+
12
+ Encoding.default_external = Encoding::UTF_8
13
+ Encoding.default_internal = Encoding::UTF_8
10
14
 
11
15
  module Wanikani
12
16
  API_ENDPOINT = "http://www.wanikani.com/api/user"
metadata CHANGED
@@ -2,14 +2,14 @@
2
2
  name: wanikani
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.2
5
+ version: 0.0.3
6
6
  platform: ruby
7
7
  authors:
8
8
  - Dennis Martinez
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-31 00:00:00.000000000 Z
12
+ date: 2013-01-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  type: :runtime
@@ -86,6 +86,7 @@ files:
86
86
  - lib/wanikani/srs.rb
87
87
  - lib/wanikani/user.rb
88
88
  - lib/wanikani/level.rb
89
+ - lib/wanikani/critical_items.rb
89
90
  - lib/wanikani.rb
90
91
  homepage: http://github.com/dennmart/wanikani-gem
91
92
  licenses: []
@@ -98,7 +99,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
98
99
  requirements:
99
100
  - - ! '>='
100
101
  - !ruby/object:Gem::Version
101
- version: '0'
102
+ version: 1.9.2
102
103
  required_rubygems_version: !ruby/object:Gem::Requirement
103
104
  none: false
104
105
  requirements: