KerbalStuff 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/KerbalStuff.rb +20 -0
- metadata +1 -1
data/lib/KerbalStuff.rb
CHANGED
@@ -22,16 +22,28 @@ module KerbalStuff
|
|
22
22
|
response
|
23
23
|
end
|
24
24
|
|
25
|
+
# Searches for mods with the specified keyword/phrase.
|
26
|
+
#
|
27
|
+
# @param query [String] the keyword/phrase to search for.
|
28
|
+
# @return [String] A parsed JSON output containing the mods which were found.
|
25
29
|
def self.SearchMod(query)
|
26
30
|
response = get_https_response("#{SEARCH_MOD}#{query}")
|
27
31
|
JSON.parse(response.body)
|
28
32
|
end
|
29
33
|
|
34
|
+
# Searches for users with the specified keyword/phrase.
|
35
|
+
#
|
36
|
+
# @param query [String] the keyword/phrase to search for.
|
37
|
+
# @return [String] A parsed JSON output containing the users which were found.
|
30
38
|
def self.SearchUser(query)
|
31
39
|
response = get_https_response("#{SEARCH_USER}#{query}")
|
32
40
|
JSON.parse(response.body)
|
33
41
|
end
|
34
42
|
|
43
|
+
# Retrieves information about the specified user.
|
44
|
+
#
|
45
|
+
# @param username [String] the username to retrieve its information.
|
46
|
+
# @return [String] A parsed JSON output containing the information about the user.
|
35
47
|
def self.User(username)
|
36
48
|
raise "username cannot be nil" unless username.length > 0
|
37
49
|
|
@@ -39,6 +51,10 @@ module KerbalStuff
|
|
39
51
|
JSON.parse(response.body)
|
40
52
|
end
|
41
53
|
|
54
|
+
# Retrieves the information about the specified mod.
|
55
|
+
#
|
56
|
+
# @param id [Fixnum] the id to retrieve its information.
|
57
|
+
# @return [String] A parsed JSON output containing the information about the mod.
|
42
58
|
def self.Mod(id)
|
43
59
|
raise "id cannot be nil" unless id.is_a?(Integer) and id > 0
|
44
60
|
|
@@ -46,6 +62,10 @@ module KerbalStuff
|
|
46
62
|
JSON.parse(response.body)
|
47
63
|
end
|
48
64
|
|
65
|
+
# Retrieves the information about the slast released version of the specified mod.
|
66
|
+
#
|
67
|
+
# @param username [Fixnum] the id to retrieve information of its latest version released.
|
68
|
+
# @return [String] A parsed JSON output containing the information about the latest version released.
|
49
69
|
def self.GetLatestVersion(id)
|
50
70
|
raise "id cannot be nil" unless id.is_a?(Integer) and id > 0
|
51
71
|
|