lib/nicoquery/api/base.rb in nicoquery-0.1.4 vs lib/nicoquery/api/base.rb in nicoquery-0.1.5
- old
+ new
@@ -3,10 +3,12 @@
module NicoQuery
module Api
class Base
+ attr_reader :forbidden
+
def scheme
'http'
end
def params
@@ -27,10 +29,14 @@
end
def get
RestClient.get uri.to_s do |response, request, result, &block|
case response.code
- when 200 || 403
+ when 200
+ @forbidden = false
+ response
+ when 403
+ @forbidden = true
response
end
end
end
end