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.



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

Returns:

  • (Boolean)


52
53
54
# File 'lib/rio/ios/mode.rb', line 52

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

#can_read?Boolean

Returns:

  • (Boolean)


49
50
51
# File 'lib/rio/ios/mode.rb', line 49

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

#can_write?Boolean

Returns:

  • (Boolean)


46
47
48
# File 'lib/rio/ios/mode.rb', line 46

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

#to_sObject



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

def to_s() @str end