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.
41 42 43 |
# File 'lib/rio/ios/generic.rb', line 41 def initialize(mode_string) @str = mode_string end |
Instance Method Details
#=~(re) ⇒ Object
54 55 56 |
# File 'lib/rio/ios/generic.rb', line 54 def =~(re) re =~ @str end |
#appends? ⇒ Boolean
51 52 53 |
# File 'lib/rio/ios/generic.rb', line 51 def appends? @str =~ /^a/ end |
#can_read? ⇒ Boolean
48 49 50 |
# File 'lib/rio/ios/generic.rb', line 48 def can_read? @str =~ /^r/ or @str =~ /\+/ end |
#can_write? ⇒ Boolean
45 46 47 |
# File 'lib/rio/ios/generic.rb', line 45 def can_write? @str =~ /^[aw]/ or @str =~ /\+/ end |
#to_s ⇒ Object
44 |
# File 'lib/rio/ios/generic.rb', line 44 def to_s() @str end |