lib/pupil/blocks.rb in pupil-0.6.3 vs lib/pupil/blocks.rb in pupil-0.7
- old
+ new
@@ -1,30 +1,30 @@
class Pupil
# @param [Fixnum] id id
# @return [Pupil::User] response
def block(param)
- response = self.post("/1.1/blocks/create.json", {guess_parameter(param) => param})
+ response = self.post("blocks/create.json", {guess_parameter(param) => param})
if response.class == Hash && response["id"]
return User.new response
end
return false
end
# @param [Fixnum] id id
# @return [Pupil::User] response
def unblock(param)
- response = self.post("/1.1/blocks/destroy.json", {guess_parameter(param) => param})
+ response = self.post("blocks/destroy.json", {guess_parameter(param) => param})
if response.class == Hash && response["id"]
return User.new response
end
return false
end
# @return [Array] list of blocking users
def blocking
- response = self.get("/1.1/blocks/list.json")
+ response = self.get("blocks/list.json")
return [] if response["nilclasses"]
users = Array.new
response["users"].each do |element|
user = User.new element
users << user
\ No newline at end of file