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