Class: Pixab::FileMode
- Inherits:
-
Object
- Object
- Pixab::FileMode
- Defined in:
- lib/Utilities/FileMode.rb
Instance Attribute Summary collapse
-
#mode ⇒ Object
readonly
Returns the value of attribute mode.
Instance Method Summary collapse
-
#initialize(mode) ⇒ FileMode
constructor
A new instance of FileMode.
- #is_add ⇒ Object
- #is_replace ⇒ Object
Constructor Details
#initialize(mode) ⇒ FileMode
Returns a new instance of FileMode.
7 8 9 |
# File 'lib/Utilities/FileMode.rb', line 7 def initialize(mode) @mode = mode end |
Instance Attribute Details
#mode ⇒ Object (readonly)
Returns the value of attribute mode.
5 6 7 |
# File 'lib/Utilities/FileMode.rb', line 5 def mode @mode end |
Instance Method Details
#is_add ⇒ Object
11 12 13 |
# File 'lib/Utilities/FileMode.rb', line 11 def is_add @mode.start_with?('a') end |
#is_replace ⇒ Object
15 16 17 |
# File 'lib/Utilities/FileMode.rb', line 15 def is_replace @mode.start_with?('w') end |