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.



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

Returns:

  • (Boolean)


51
52
53
# File 'lib/rio/ios/generic.rb', line 51

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

#can_read?Boolean

Returns:

  • (Boolean)


48
49
50
# File 'lib/rio/ios/generic.rb', line 48

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

#can_write?Boolean

Returns:

  • (Boolean)


45
46
47
# File 'lib/rio/ios/generic.rb', line 45

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

#to_sObject



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

def to_s() @str end