Class: RIO::NullIOMode
Overview
:nodoc: all
Instance Method Summary collapse
- #=~(re) ⇒ Object
- #appends? ⇒ Boolean
- #can_read? ⇒ Boolean
- #can_write? ⇒ Boolean
-
#initialize(mode_string) ⇒ NullIOMode
constructor
A new instance of NullIOMode.
- #to_s ⇒ Object
Constructor Details
#initialize(mode_string) ⇒ NullIOMode
Returns a new instance of NullIOMode.
46 47 48 |
# File 'lib/rio/nullio.rb', line 46 def initialize(mode_string) @str = mode_string end |
Instance Method Details
#=~(re) ⇒ Object
59 60 61 |
# File 'lib/rio/nullio.rb', line 59 def =~(re) re =~ @str end |
#appends? ⇒ Boolean
56 57 58 |
# File 'lib/rio/nullio.rb', line 56 def appends? @str =~ /^a/ end |
#can_read? ⇒ Boolean
53 54 55 |
# File 'lib/rio/nullio.rb', line 53 def can_read? @str =~ /^r/ or @str =~ /\+/ end |
#can_write? ⇒ Boolean
50 51 52 |
# File 'lib/rio/nullio.rb', line 50 def can_write? @str =~ /^[aw]/ or @str =~ /\+/ end |
#to_s ⇒ Object
49 |
# File 'lib/rio/nullio.rb', line 49 def to_s() @str end |