Class: NameChecker::FacebookChecker
- Inherits:
-
Object
- Object
- NameChecker::FacebookChecker
show all
- Includes:
- HTTParty, Logging
- Defined in:
- lib/name_checker/facebook_checker.rb
Constant Summary
collapse
- MIN_NAME_LENGTH =
5
Class Method Summary
collapse
Methods included from Logging
infer_level, logger, #logger
Class Method Details
.check(name, options = {}) ⇒ Object
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'lib/name_checker/facebook_checker.rb', line 9
def self.check(name, options = {})
if name.length < MIN_NAME_LENGTH
return Availability.new(@service_name, false)
end
res = get("/#{name}")
rescue MultiJson::DecodeError
Availability.new(@service_name, false)
else
status = handle_response(res, name)
Availability.new(@service_name, status)
end
|