Module: FileMode::ClassMethods
- Included in:
- FileMode
- Defined in:
- lib/file_mode.rb
Overview
Class methods. These are both extended into the FileMode class and mixed-in as instance methods on classes that “include FileMode” when the class Fixnum attribute :mode is used in place of the argument of the same name.
Instance Method Summary collapse
-
#group_executable?(mode) ⇒ Boolean
Return true if the mode is executable by group, false otherwise.
-
#group_readable?(mode) ⇒ Boolean
Return true if the mode is readable by group, false otherwise.
-
#group_writable?(mode) ⇒ Boolean
Return true if the mode is writable by group, false otherwise.
-
#other_executable?(mode) ⇒ Boolean
Return true if the mode is executable by other, false otherwise.
-
#other_readable?(mode) ⇒ Boolean
Return true if the mode is readable by other, false otherwise.
-
#other_writable?(mode) ⇒ Boolean
Return true if the mode is writable by other, false otherwise.
-
#setgid?(mode) ⇒ Boolean
Return true if mode has the setgid bit set, false otherwise.
-
#setuid?(mode) ⇒ Boolean
Return true if mode has the setuid bit set, false otherwise.
-
#sticky?(mode) ⇒ Boolean
Return true if mode has the sticky bit set, false otherwise.
-
#user_executable?(mode) ⇒ Boolean
Return true if the mode is executable by user, false otherwise.
-
#user_readable?(mode) ⇒ Boolean
Return true if the mode is readable by user, false otherwise.
-
#user_writable?(mode) ⇒ Boolean
Return true if the mode is writable by user, false otherwise.
Instance Method Details
#group_executable?(mode) ⇒ Boolean
Return true if the mode is executable by group, false otherwise.
49 50 51 |
# File 'lib/file_mode.rb', line 49 def group_executable?(mode) mode & 00010 == 00010 end |
#group_readable?(mode) ⇒ Boolean
Return true if the mode is readable by group, false otherwise.
19 20 21 |
# File 'lib/file_mode.rb', line 19 def group_readable?(mode) mode & 00040 == 00040 end |
#group_writable?(mode) ⇒ Boolean
Return true if the mode is writable by group, false otherwise.
34 35 36 |
# File 'lib/file_mode.rb', line 34 def group_writable?(mode) mode & 00020 == 00020 end |
#other_executable?(mode) ⇒ Boolean
Return true if the mode is executable by other, false otherwise.
54 55 56 |
# File 'lib/file_mode.rb', line 54 def other_executable?(mode) mode & 00001 == 00001 end |
#other_readable?(mode) ⇒ Boolean
Return true if the mode is readable by other, false otherwise.
24 25 26 |
# File 'lib/file_mode.rb', line 24 def other_readable?(mode) mode & 00004 == 00004 end |
#other_writable?(mode) ⇒ Boolean
Return true if the mode is writable by other, false otherwise.
39 40 41 |
# File 'lib/file_mode.rb', line 39 def other_writable?(mode) mode & 00002 == 00002 end |
#setgid?(mode) ⇒ Boolean
Return true if mode has the setgid bit set, false otherwise.
64 65 66 |
# File 'lib/file_mode.rb', line 64 def setgid?(mode) mode & 02000 == 02000 end |
#setuid?(mode) ⇒ Boolean
Return true if mode has the setuid bit set, false otherwise.
59 60 61 |
# File 'lib/file_mode.rb', line 59 def setuid?(mode) mode & 04000 == 04000 end |
#sticky?(mode) ⇒ Boolean
Return true if mode has the sticky bit set, false otherwise.
69 70 71 |
# File 'lib/file_mode.rb', line 69 def sticky?(mode) mode & 01000 == 01000 end |
#user_executable?(mode) ⇒ Boolean
Return true if the mode is executable by user, false otherwise.
44 45 46 |
# File 'lib/file_mode.rb', line 44 def user_executable?(mode) mode & 00100 == 00100 end |
#user_readable?(mode) ⇒ Boolean
Return true if the mode is readable by user, false otherwise.
14 15 16 |
# File 'lib/file_mode.rb', line 14 def user_readable?(mode) mode & 00400 == 00400 end |
#user_writable?(mode) ⇒ Boolean
Return true if the mode is writable by user, false otherwise.
29 30 31 |
# File 'lib/file_mode.rb', line 29 def user_writable?(mode) mode & 00200 == 00200 end |