Class: RIO::GenericIOMode

Inherits:
Object show all
Defined in:
lib/rio/ios/generic.rb

Overview

:nodoc: all

Instance Method Summary collapse

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

Returns:

  • (Boolean)


40
41
42
# File 'lib/rio/ios/generic.rb', line 40

def appends?
  @str =~ /^a/
end

#can_read?Boolean

Returns:

  • (Boolean)


37
38
39
# File 'lib/rio/ios/generic.rb', line 37

def can_read?
  @str =~ /^r/ or @str =~ /\+/
end

#can_write?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/rio/ios/generic.rb', line 34

def can_write?
  @str =~ /^[aw]/ or @str =~ /\+/
end

#to_sObject



33
# File 'lib/rio/ios/generic.rb', line 33

def to_s() @str end