Class: Wanikani::CriticalItems
- Inherits:
-
Object
- Object
- Wanikani::CriticalItems
- Defined in:
- lib/wanikani/critical_items.rb
Class Method Summary collapse
-
.critical(percentage = 75) ⇒ Array
Gets the user’s current items under ‘Critical Items’.
-
.full_response(percentage = 75) ⇒ Hash
Gets the full response of the Critical Items List API call.
Class Method Details
.critical(percentage = 75) ⇒ Array
Gets the user’s current items under ‘Critical Items’.
8 9 10 11 12 |
# File 'lib/wanikani/critical_items.rb', line 8 def self.critical(percentage = 75) raise ArgumentError, "Percentage must be an Integer between 0 and 100" if !percentage.between?(0, 100) api_response = Wanikani.api_response("critical-items", percentage) return api_response["requested_information"] end |
.full_response(percentage = 75) ⇒ Hash
Gets the full response of the Critical Items List API call.
18 19 20 21 |
# File 'lib/wanikani/critical_items.rb', line 18 def self.full_response(percentage = 75) raise ArgumentError, "Percentage must be an Integer between 0 and 100" if !percentage.between?(0, 100) return Wanikani.api_response("critical-items", percentage) end |