Module: Moped::GridFS::AccessModes
- Included in:
- File
- Defined in:
- lib/moped/gridfs/access_modes.rb
Constant Summary collapse
- ACCESS_MODES =
%w[r r+ w w+ a a+]
Instance Attribute Summary collapse
-
#mode ⇒ Object
readonly
Returns the value of attribute mode.
Instance Method Summary collapse
- #append? ⇒ Boolean
- #read_only? ⇒ Boolean
- #read_write? ⇒ Boolean
- #readable? ⇒ Boolean
- #writable? ⇒ Boolean
- #write_only? ⇒ Boolean
Instance Attribute Details
#mode ⇒ Object (readonly)
Returns the value of attribute mode.
5 6 7 |
# File 'lib/moped/gridfs/access_modes.rb', line 5 def mode @mode end |
Instance Method Details
#append? ⇒ Boolean
17 18 19 |
# File 'lib/moped/gridfs/access_modes.rb', line 17 def append? mode =~ /a/ end |
#read_only? ⇒ Boolean
21 22 23 |
# File 'lib/moped/gridfs/access_modes.rb', line 21 def read_only? mode == 'r' end |
#read_write? ⇒ Boolean
29 30 31 |
# File 'lib/moped/gridfs/access_modes.rb', line 29 def read_write? mode =~ /\+/ end |
#readable? ⇒ Boolean
9 10 11 |
# File 'lib/moped/gridfs/access_modes.rb', line 9 def readable? mode =~ /r|\+/ end |
#writable? ⇒ Boolean
13 14 15 |
# File 'lib/moped/gridfs/access_modes.rb', line 13 def writable? mode =~ /w|\+|a/ end |
#write_only? ⇒ Boolean
25 26 27 |
# File 'lib/moped/gridfs/access_modes.rb', line 25 def write_only? mode == 'w' or mode == 'a' end |