Class: Gotta::Mod::Event
- Inherits:
-
Object
- Object
- Gotta::Mod::Event
- Defined in:
- lib/gotta/mod/event.rb
Instance Attribute Summary collapse
-
#absolute_path ⇒ Object
readonly
Returns the value of attribute absolute_path.
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#working_directory ⇒ Object
readonly
Returns the value of attribute working_directory.
Instance Method Summary collapse
- #added? ⇒ Boolean
-
#initialize(type:, absolute_path:, working_directory:) ⇒ Event
constructor
A new instance of Event.
- #modified? ⇒ Boolean
- #removed? ⇒ Boolean
Constructor Details
#initialize(type:, absolute_path:, working_directory:) ⇒ Event
Returns a new instance of Event.
12 13 14 15 16 17 18 19 |
# File 'lib/gotta/mod/event.rb', line 12 def initialize(type:, absolute_path:, working_directory:) @working_directory = working_directory @absolute_path = absolute_path @path = relative_path_for(@absolute_path.dup) @filename = File.basename(@absolute_path) @type = type make_it_immutable end |
Instance Attribute Details
#absolute_path ⇒ Object (readonly)
Returns the value of attribute absolute_path.
6 7 8 |
# File 'lib/gotta/mod/event.rb', line 6 def absolute_path @absolute_path end |
#filename ⇒ Object (readonly)
Returns the value of attribute filename.
6 7 8 |
# File 'lib/gotta/mod/event.rb', line 6 def filename @filename end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
6 7 8 |
# File 'lib/gotta/mod/event.rb', line 6 def path @path end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
6 7 8 |
# File 'lib/gotta/mod/event.rb', line 6 def type @type end |
#working_directory ⇒ Object (readonly)
Returns the value of attribute working_directory.
6 7 8 |
# File 'lib/gotta/mod/event.rb', line 6 def working_directory @working_directory end |
Instance Method Details
#added? ⇒ Boolean
21 22 23 |
# File 'lib/gotta/mod/event.rb', line 21 def added? @type == :added end |
#modified? ⇒ Boolean
25 26 27 |
# File 'lib/gotta/mod/event.rb', line 25 def modified? @type == :modified end |
#removed? ⇒ Boolean
29 30 31 |
# File 'lib/gotta/mod/event.rb', line 29 def removed? @type == :removed end |