Class: RFlags::FileFlag
- Inherits:
-
Object
- Object
- RFlags::FileFlag
- Defined in:
- lib/rflags/file_flag.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(path) ⇒ FileFlag
constructor
A new instance of FileFlag.
- #reset ⇒ Object
- #set ⇒ Object
- #set? ⇒ Boolean
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
#path ⇒ Object (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
#reset ⇒ Object
17 18 19 |
# File 'lib/rflags/file_flag.rb', line 17 def reset File.delete(path) if File.file?(path) end |
#set ⇒ Object
13 14 15 |
# File 'lib/rflags/file_flag.rb', line 13 def set File.write(path, '') end |
#set? ⇒ Boolean
9 10 11 |
# File 'lib/rflags/file_flag.rb', line 9 def set? File.file?(path) end |