Class: RFlags::FileFlag

Inherits:
Object
  • Object
show all
Defined in:
lib/rflags/file_flag.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ FileFlag

Returns a new instance of FileFlag.



5
6
7
# File 'lib/rflags/file_flag.rb', line 5

def initialize(path)
  @path = path
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



3
4
5
# File 'lib/rflags/file_flag.rb', line 3

def path
  @path
end

Instance Method Details

#resetObject



17
18
19
# File 'lib/rflags/file_flag.rb', line 17

def reset
  File.delete(path) if File.file?(path)
end

#setObject



13
14
15
# File 'lib/rflags/file_flag.rb', line 13

def set
  File.write(path, '')
end

#set?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/rflags/file_flag.rb', line 9

def set?
  File.file?(path)
end