Class: MockFS::FileAdapter::Mode
- Inherits:
-
Object
- Object
- MockFS::FileAdapter::Mode
- Defined in:
- lib/mockfs.rb
Overview
:nodoc:
Instance Method Summary collapse
- #append? ⇒ Boolean
-
#initialize(string_or_bitwise) ⇒ Mode
constructor
A new instance of Mode.
- #read_only? ⇒ Boolean
Constructor Details
#initialize(string_or_bitwise) ⇒ Mode
Returns a new instance of Mode.
325 326 327 328 329 330 331 332 333 334 335 336 337 |
# File 'lib/mockfs.rb', line 325 def initialize( string_or_bitwise ) if string_or_bitwise.is_a?( String ) if string_or_bitwise == 'w' @bitwise = File::WRONLY elsif string_or_bitwise == 'r' @bitwise = File::RDONLY elsif string_or_bitwise == 'a' @bitwise = File::APPEND end else @bitwise = string_or_bitwise end end |