Module: External::Patches::Ruby18Io
- Defined in:
- lib/external/patches/ruby_1_8_io.rb
Instance Attribute Summary collapse
-
#generic_mode ⇒ Object
readonly
Returns the value of attribute generic_mode.
Class Method Summary collapse
Instance Method Summary collapse
- #flush ⇒ Object
- #fsync ⇒ Object
-
#quick_compare(another) ⇒ Object
Quick comparision with another IO.
Instance Attribute Details
#generic_mode ⇒ Object (readonly)
Returns the value of attribute generic_mode.
4 5 6 |
# File 'lib/external/patches/ruby_1_8_io.rb', line 4 def generic_mode @generic_mode end |
Class Method Details
Instance Method Details
#flush ⇒ Object
10 11 12 |
# File 'lib/external/patches/ruby_1_8_io.rb', line 10 def flush super unless generic_mode == "r" end |
#fsync ⇒ Object
14 15 16 |
# File 'lib/external/patches/ruby_1_8_io.rb', line 14 def fsync super unless generic_mode == "r" end |
#quick_compare(another) ⇒ Object
Quick comparision with another IO. Returns true if another == self, or if both are file-type IOs and their paths are equal.
21 22 23 24 25 26 |
# File 'lib/external/patches/ruby_1_8_io.rb', line 21 def quick_compare(another) self == another || ( (self.kind_of?(File) || self.kind_of?(Tempfile)) && (another.kind_of?(File) || another.kind_of?(Tempfile)) && self.path == another.path) end |