Class: CodewarsApi::KataInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/codewars_api/kata_info.rb

Instance Method Summary collapse

Constructor Details

#initialize(id) ⇒ KataInfo


3
4
5
# File 'lib/codewars_api/kata_info.rb', line 3

def initialize(id)
  @response = RequestHelper.get("#{CodewarsApi::API_URL}/code-challenges/#{id}")
end

Instance Method Details

#approved_atObject


27
28
29
# File 'lib/codewars_api/kata_info.rb', line 27

def approved_at
  @response.to_h['approvedAt']
end

#approver_urlObject


59
60
61
# File 'lib/codewars_api/kata_info.rb', line 59

def approver_url
  @response.to_h['approvedBy'].andand['url']
end

#approver_usernameObject


55
56
57
# File 'lib/codewars_api/kata_info.rb', line 55

def approver_username
  @response.to_h['approvedBy'].andand['username']
end

#categoryObject


19
20
21
# File 'lib/codewars_api/kata_info.rb', line 19

def category
  @response.to_h['category']
end

#contributors_wantedObject


87
88
89
# File 'lib/codewars_api/kata_info.rb', line 87

def contributors_wanted
  @response.to_h['contributorsWanted']
end

#created_atObject


43
44
45
# File 'lib/codewars_api/kata_info.rb', line 43

def created_at
  @response.to_h['createdAt']
end

#creater_urlObject


51
52
53
# File 'lib/codewars_api/kata_info.rb', line 51

def creater_url
  @response.to_h['createdBy'].andand['url']
end

#creater_usernameObject


47
48
49
# File 'lib/codewars_api/kata_info.rb', line 47

def creater_username
  @response.to_h['createdBy'].andand['username']
end

#descriptionObject


63
64
65
# File 'lib/codewars_api/kata_info.rb', line 63

def description
  @response.to_h['description']
end

#idObject


7
8
9
# File 'lib/codewars_api/kata_info.rb', line 7

def id
  @response.to_h['id']
end

#languagesObject


31
32
33
# File 'lib/codewars_api/kata_info.rb', line 31

def languages
  @response.to_h['languages']
end

#nameObject


11
12
13
# File 'lib/codewars_api/kata_info.rb', line 11

def name
  @response.to_h['name']
end

#published_atObject


23
24
25
# File 'lib/codewars_api/kata_info.rb', line 23

def published_at
  @response.to_h['publishedAt']
end

#rankObject


39
40
41
# File 'lib/codewars_api/kata_info.rb', line 39

def rank
  @response.to_h['rank']
end

#slugObject


15
16
17
# File 'lib/codewars_api/kata_info.rb', line 15

def slug
  @response.to_h['slug']
end

#tagsObject


83
84
85
# File 'lib/codewars_api/kata_info.rb', line 83

def tags
  @response.to_h['tags']
end

#to_hObject


99
100
101
# File 'lib/codewars_api/kata_info.rb', line 99

def to_h
  @response.to_h
end

#total_attemptsObject


67
68
69
# File 'lib/codewars_api/kata_info.rb', line 67

def total_attempts
  @response.to_h['totalAttempts']
end

#total_completedObject


71
72
73
# File 'lib/codewars_api/kata_info.rb', line 71

def total_completed
  @response.to_h['totalCompleted']
end

#total_starsObject


75
76
77
# File 'lib/codewars_api/kata_info.rb', line 75

def total_stars
  @response.to_h['totalStars']
end

#unresolved_issuesObject


91
92
93
# File 'lib/codewars_api/kata_info.rb', line 91

def unresolved_issues
  @response.to_h['unresolved'].andand['issues']
end

#unresolved_suggestionsObject


95
96
97
# File 'lib/codewars_api/kata_info.rb', line 95

def unresolved_suggestions
  @response.to_h['unresolved'].andand['suggestions']
end

#urlObject


35
36
37
# File 'lib/codewars_api/kata_info.rb', line 35

def url
  @response.to_h['url']
end

#vote_scoreObject


79
80
81
# File 'lib/codewars_api/kata_info.rb', line 79

def vote_score
  @response.to_h['voteScore']
end