Class: CodewarsApi::KataInfo
- Inherits:
-
Object
- Object
- CodewarsApi::KataInfo
- Includes:
- Common
- Defined in:
- lib/codewars_api/kata_info.rb
Instance Method Summary collapse
- #approved_at ⇒ Object
- #approver_url ⇒ Object
- #approver_username ⇒ Object
- #category ⇒ Object
- #contributors_wanted ⇒ Object
- #created_at ⇒ Object
- #creater_url ⇒ Object
- #creater_username ⇒ Object
- #description ⇒ Object
- #id ⇒ Object
-
#initialize(id) ⇒ KataInfo
constructor
A new instance of KataInfo.
- #languages ⇒ Object
- #name ⇒ Object
- #published_at ⇒ Object
- #rank ⇒ Object
- #slug ⇒ Object
- #tags ⇒ Object
- #total_attempts ⇒ Object
- #total_completed ⇒ Object
- #total_stars ⇒ Object
- #unresolved_issues ⇒ Object
- #unresolved_suggestions ⇒ Object
- #url ⇒ Object
- #vote_score ⇒ Object
Methods included from Common
Constructor Details
#initialize(id) ⇒ KataInfo
Returns a new instance of KataInfo.
5 6 7 8 |
# File 'lib/codewars_api/kata_info.rb', line 5 def initialize(id) @response = RequestHelper.get("#{CodewarsApi::API_URL}/code-challenges/#{id}") ResponseChecker.check_errors(@response) end |
Instance Method Details
#approved_at ⇒ Object
30 31 32 |
# File 'lib/codewars_api/kata_info.rb', line 30 def approved_at @response.to_h['approvedAt'] end |
#approver_url ⇒ Object
62 63 64 |
# File 'lib/codewars_api/kata_info.rb', line 62 def approver_url @response.to_h['approvedBy'].andand['url'] end |
#approver_username ⇒ Object
58 59 60 |
# File 'lib/codewars_api/kata_info.rb', line 58 def approver_username @response.to_h['approvedBy'].andand['username'] end |
#category ⇒ Object
22 23 24 |
# File 'lib/codewars_api/kata_info.rb', line 22 def category @response.to_h['category'] end |
#contributors_wanted ⇒ Object
90 91 92 |
# File 'lib/codewars_api/kata_info.rb', line 90 def contributors_wanted @response.to_h['contributorsWanted'] end |
#created_at ⇒ Object
46 47 48 |
# File 'lib/codewars_api/kata_info.rb', line 46 def created_at @response.to_h['createdAt'] end |
#creater_url ⇒ Object
54 55 56 |
# File 'lib/codewars_api/kata_info.rb', line 54 def creater_url @response.to_h['createdBy'].andand['url'] end |
#creater_username ⇒ Object
50 51 52 |
# File 'lib/codewars_api/kata_info.rb', line 50 def creater_username @response.to_h['createdBy'].andand['username'] end |
#description ⇒ Object
66 67 68 |
# File 'lib/codewars_api/kata_info.rb', line 66 def description @response.to_h['description'] end |
#id ⇒ Object
10 11 12 |
# File 'lib/codewars_api/kata_info.rb', line 10 def id @response.to_h['id'] end |
#languages ⇒ Object
34 35 36 |
# File 'lib/codewars_api/kata_info.rb', line 34 def languages @response.to_h['languages'] end |
#name ⇒ Object
14 15 16 |
# File 'lib/codewars_api/kata_info.rb', line 14 def name @response.to_h['name'] end |
#published_at ⇒ Object
26 27 28 |
# File 'lib/codewars_api/kata_info.rb', line 26 def published_at @response.to_h['publishedAt'] end |
#rank ⇒ Object
42 43 44 |
# File 'lib/codewars_api/kata_info.rb', line 42 def rank @response.to_h['rank'] end |
#slug ⇒ Object
18 19 20 |
# File 'lib/codewars_api/kata_info.rb', line 18 def slug @response.to_h['slug'] end |
#tags ⇒ Object
86 87 88 |
# File 'lib/codewars_api/kata_info.rb', line 86 def @response.to_h['tags'] end |
#total_attempts ⇒ Object
70 71 72 |
# File 'lib/codewars_api/kata_info.rb', line 70 def total_attempts @response.to_h['totalAttempts'] end |
#total_completed ⇒ Object
74 75 76 |
# File 'lib/codewars_api/kata_info.rb', line 74 def total_completed @response.to_h['totalCompleted'] end |
#total_stars ⇒ Object
78 79 80 |
# File 'lib/codewars_api/kata_info.rb', line 78 def total_stars @response.to_h['totalStars'] end |
#unresolved_issues ⇒ Object
94 95 96 |
# File 'lib/codewars_api/kata_info.rb', line 94 def unresolved_issues @response.to_h['unresolved'].andand['issues'] end |
#unresolved_suggestions ⇒ Object
98 99 100 |
# File 'lib/codewars_api/kata_info.rb', line 98 def unresolved_suggestions @response.to_h['unresolved'].andand['suggestions'] end |
#url ⇒ Object
38 39 40 |
# File 'lib/codewars_api/kata_info.rb', line 38 def url @response.to_h['url'] end |
#vote_score ⇒ Object
82 83 84 |
# File 'lib/codewars_api/kata_info.rb', line 82 def vote_score @response.to_h['voteScore'] end |