Class: RIO::IOS::Mode

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

Overview

:nodoc: all

Instance Method Summary collapse

Constructor Details

#initialize(mode_string) ⇒ Mode

Returns a new instance of Mode.



31
32
33
# File 'lib/rio/ios/mode.rb', line 31

def initialize(mode_string)
  @str = mode_string
end

Instance Method Details

#=~(re) ⇒ Object



44
45
46
# File 'lib/rio/ios/mode.rb', line 44

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

#appends?Boolean

Returns:

  • (Boolean)


41
42
43
# File 'lib/rio/ios/mode.rb', line 41

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

#can_read?Boolean

Returns:

  • (Boolean)


38
39
40
# File 'lib/rio/ios/mode.rb', line 38

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

#can_write?Boolean

Returns:

  • (Boolean)


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

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

#to_sObject



34
# File 'lib/rio/ios/mode.rb', line 34

def to_s() @str end