fraggle 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/fraggle/response.rb +16 -8
- metadata +2 -2
data/lib/fraggle/response.rb
CHANGED
@@ -14,20 +14,28 @@ module Fraggle
|
|
14
14
|
Dir = -2
|
15
15
|
Dummy = -3
|
16
16
|
|
17
|
+
Refused = -1
|
18
|
+
|
17
19
|
# CAS
|
18
20
|
def missing? ; cas == Missing ; end
|
19
21
|
def dir? ; cas == Dir ; end
|
20
22
|
def dummy? ; cas == Dummy ; end
|
21
23
|
|
24
|
+
def del? ; missing? ; end
|
25
|
+
def set? ; !del? ; end
|
26
|
+
|
22
27
|
# ERR
|
23
|
-
def ok? ;
|
24
|
-
def other? ;
|
25
|
-
def unknown_verb? ;
|
26
|
-
def redirect? ;
|
27
|
-
def invalid_snap? ;
|
28
|
-
def mismatch? ;
|
29
|
-
def not_dir? ;
|
30
|
-
def is_dir? ;
|
28
|
+
def ok? ; err_code != 0 ; end
|
29
|
+
def other? ; err_code == Err::OTHER ; end
|
30
|
+
def unknown_verb? ; err_code == Err::UNKNOWN_VERB ; end
|
31
|
+
def redirect? ; err_code == Err::REDIRECT ; end
|
32
|
+
def invalid_snap? ; err_code == Err::INVALID_SNAP ; end
|
33
|
+
def mismatch? ; err_code == Err::CAS_MISMATCH ; end
|
34
|
+
def not_dir? ; err_code == Err::NOT_DIR ; end
|
35
|
+
def is_dir? ; err_code == Err::ISDIR ; end
|
36
|
+
|
37
|
+
# Custom
|
38
|
+
def disconnected? ; err_code == Errno::ECONNREFUSED::Errno ; end
|
31
39
|
end
|
32
40
|
|
33
41
|
end
|