Class: GitWit::Actions::Etc::Base
- Inherits:
-
Thor::Actions::EmptyDirectory
- Object
- Thor::Actions::EmptyDirectory
- GitWit::Actions::Etc::Base
- Defined in:
- lib/git_wit/actions/etc/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#base ⇒ Object
readonly
Returns the value of attribute base.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #exists? ⇒ Boolean
-
#initialize(base, type, name, config = {}) ⇒ Base
constructor
A new instance of Base.
- #invoke! ⇒ Object
- #revoke! ⇒ Object
Constructor Details
#initialize(base, type, name, config = {}) ⇒ Base
Returns a new instance of Base.
6 7 8 9 |
# File 'lib/git_wit/actions/etc/base.rb', line 6 def initialize(base, type, name, config = {}) @base, @type, @name = base, type, name @config = {verbose: true}.merge config end |
Instance Attribute Details
#base ⇒ Object (readonly)
Returns the value of attribute base.
4 5 6 |
# File 'lib/git_wit/actions/etc/base.rb', line 4 def base @base end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/git_wit/actions/etc/base.rb', line 4 def name @name end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
4 5 6 |
# File 'lib/git_wit/actions/etc/base.rb', line 4 def type @type end |
Instance Method Details
#exists? ⇒ Boolean
22 23 24 |
# File 'lib/git_wit/actions/etc/base.rb', line 22 def exists? etc_exists? end |
#invoke! ⇒ Object
11 12 13 14 15 |
# File 'lib/git_wit/actions/etc/base.rb', line 11 def invoke! invoke_with_conflict_check do create end end |
#revoke! ⇒ Object
17 18 19 20 |
# File 'lib/git_wit/actions/etc/base.rb', line 17 def revoke! say_status :remove, :red destroy if !pretend? && exists? end |