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.
35 36 37 |
# File 'lib/rio/nullio.rb', line 35 def initialize(mode_string) @str = mode_string end |
Instance Method Details
#=~(re) ⇒ Object
48 49 50 |
# File 'lib/rio/nullio.rb', line 48 def =~(re) re =~ @str end |
#appends? ⇒ Boolean
45 46 47 |
# File 'lib/rio/nullio.rb', line 45 def appends? @str =~ /^a/ end |
#can_read? ⇒ Boolean
42 43 44 |
# File 'lib/rio/nullio.rb', line 42 def can_read? @str =~ /^r/ or @str =~ /\+/ end |
#can_write? ⇒ Boolean
39 40 41 |
# File 'lib/rio/nullio.rb', line 39 def can_write? @str =~ /^[aw]/ or @str =~ /\+/ end |
#to_s ⇒ Object
38 |
# File 'lib/rio/nullio.rb', line 38 def to_s() @str end |