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 |
# File 'lib/codewars_api/kata_info.rb', line 5 def initialize(id) @response = RequestHelper.get("#{CodewarsApi::API_URL}/code-challenges/#{id}") end |
Instance Method Details
#approved_at ⇒ Object
29 30 31 |
# File 'lib/codewars_api/kata_info.rb', line 29 def approved_at @response.to_h['approvedAt'] end |
#approver_url ⇒ Object
61 62 63 |
# File 'lib/codewars_api/kata_info.rb', line 61 def approver_url @response.to_h['approvedBy'].andand['url'] end |
#approver_username ⇒ Object
57 58 59 |
# File 'lib/codewars_api/kata_info.rb', line 57 def approver_username @response.to_h['approvedBy'].andand['username'] end |
#category ⇒ Object
21 22 23 |
# File 'lib/codewars_api/kata_info.rb', line 21 def category @response.to_h['category'] end |
#contributors_wanted ⇒ Object
89 90 91 |
# File 'lib/codewars_api/kata_info.rb', line 89 def contributors_wanted @response.to_h['contributorsWanted'] end |
#created_at ⇒ Object
45 46 47 |
# File 'lib/codewars_api/kata_info.rb', line 45 def created_at @response.to_h['createdAt'] end |
#creater_url ⇒ Object
53 54 55 |
# File 'lib/codewars_api/kata_info.rb', line 53 def creater_url @response.to_h['createdBy'].andand['url'] end |
#creater_username ⇒ Object
49 50 51 |
# File 'lib/codewars_api/kata_info.rb', line 49 def creater_username @response.to_h['createdBy'].andand['username'] end |
#description ⇒ Object
65 66 67 |
# File 'lib/codewars_api/kata_info.rb', line 65 def description @response.to_h['description'] end |
#id ⇒ Object
9 10 11 |
# File 'lib/codewars_api/kata_info.rb', line 9 def id @response.to_h['id'] end |
#languages ⇒ Object
33 34 35 |
# File 'lib/codewars_api/kata_info.rb', line 33 def languages @response.to_h['languages'] end |
#name ⇒ Object
13 14 15 |
# File 'lib/codewars_api/kata_info.rb', line 13 def name @response.to_h['name'] end |
#published_at ⇒ Object
25 26 27 |
# File 'lib/codewars_api/kata_info.rb', line 25 def published_at @response.to_h['publishedAt'] end |
#rank ⇒ Object
41 42 43 |
# File 'lib/codewars_api/kata_info.rb', line 41 def rank @response.to_h['rank'] end |
#slug ⇒ Object
17 18 19 |
# File 'lib/codewars_api/kata_info.rb', line 17 def slug @response.to_h['slug'] end |
#tags ⇒ Object
85 86 87 |
# File 'lib/codewars_api/kata_info.rb', line 85 def @response.to_h['tags'] end |
#total_attempts ⇒ Object
69 70 71 |
# File 'lib/codewars_api/kata_info.rb', line 69 def total_attempts @response.to_h['totalAttempts'] end |
#total_completed ⇒ Object
73 74 75 |
# File 'lib/codewars_api/kata_info.rb', line 73 def total_completed @response.to_h['totalCompleted'] end |
#total_stars ⇒ Object
77 78 79 |
# File 'lib/codewars_api/kata_info.rb', line 77 def total_stars @response.to_h['totalStars'] end |
#unresolved_issues ⇒ Object
93 94 95 |
# File 'lib/codewars_api/kata_info.rb', line 93 def unresolved_issues @response.to_h['unresolved'].andand['issues'] end |
#unresolved_suggestions ⇒ Object
97 98 99 |
# File 'lib/codewars_api/kata_info.rb', line 97 def unresolved_suggestions @response.to_h['unresolved'].andand['suggestions'] end |
#url ⇒ Object
37 38 39 |
# File 'lib/codewars_api/kata_info.rb', line 37 def url @response.to_h['url'] end |
#vote_score ⇒ Object
81 82 83 |
# File 'lib/codewars_api/kata_info.rb', line 81 def vote_score @response.to_h['voteScore'] end |