Class: RIO::GenericIOMode
Overview
:nodoc: all
Instance Method Summary collapse
- #=~(re) ⇒ Object
- #appends? ⇒ Boolean
- #can_read? ⇒ Boolean
- #can_write? ⇒ Boolean
-
#initialize(mode_string) ⇒ GenericIOMode
constructor
A new instance of GenericIOMode.
- #to_s ⇒ Object
Constructor Details
#initialize(mode_string) ⇒ GenericIOMode
Returns a new instance of GenericIOMode.
30 31 32 |
# File 'lib/rio/ios/generic.rb', line 30 def initialize(mode_string) @str = mode_string end |
Instance Method Details
#=~(re) ⇒ Object
43 44 45 |
# File 'lib/rio/ios/generic.rb', line 43 def =~(re) re =~ @str end |
#appends? ⇒ Boolean
40 41 42 |
# File 'lib/rio/ios/generic.rb', line 40 def appends? @str =~ /^a/ end |
#can_read? ⇒ Boolean
37 38 39 |
# File 'lib/rio/ios/generic.rb', line 37 def can_read? @str =~ /^r/ or @str =~ /\+/ end |
#can_write? ⇒ Boolean
34 35 36 |
# File 'lib/rio/ios/generic.rb', line 34 def can_write? @str =~ /^[aw]/ or @str =~ /\+/ end |
#to_s ⇒ Object
33 |
# File 'lib/rio/ios/generic.rb', line 33 def to_s() @str end |