Class: RIO::NullIOMode

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

Overview

:nodoc: all

Instance Method Summary collapse

Constructor Details

#initialize(mode_string) ⇒ NullIOMode

Returns a new instance of NullIOMode.



35
36
37
# File 'lib/rio/nullio.rb', line 35

def initialize(mode_string)
  @str = mode_string
end

Instance Method Details

#=~(re) ⇒ Object



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

def =~(re)
  re =~ @str
end

#appends?Boolean

Returns:

  • (Boolean)


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

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

#can_read?Boolean

Returns:

  • (Boolean)


42
43
44
# File 'lib/rio/nullio.rb', line 42

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

#can_write?Boolean

Returns:

  • (Boolean)


39
40
41
# File 'lib/rio/nullio.rb', line 39

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

#to_sObject



38
# File 'lib/rio/nullio.rb', line 38

def to_s() @str end