Class: CaseBase
- Inherits:
-
Object
- Object
- CaseBase
- Includes:
- CommandServiceObject::CheckHelper, CommandServiceObject::FailureHelper, CommandServiceObject::Hooks
- Defined in:
- lib/generators/service/install/templates/services/case_base.rb
Instance Attribute Summary collapse
-
#cmd ⇒ Object
readonly
Returns the value of attribute cmd.
-
#issuer ⇒ Object
readonly
Returns the value of attribute issuer.
-
#right_name ⇒ Object
readonly
Returns the value of attribute right_name.
Instance Method Summary collapse
- #allowed? ⇒ Boolean
- #case_name ⇒ Object
-
#initialize(cmd) ⇒ CaseBase
constructor
A new instance of CaseBase.
- #rollback ⇒ Object
- #service_name ⇒ Object
Methods included from CommandServiceObject::CheckHelper
Methods included from CommandServiceObject::FailureHelper
Methods included from CommandServiceObject::Hooks
Constructor Details
#initialize(cmd) ⇒ CaseBase
Returns a new instance of CaseBase.
13 14 15 16 17 |
# File 'lib/generators/service/install/templates/services/case_base.rb', line 13 def initialize(cmd) @cmd = cmd @issuer = cmd.try(:issuer) @right_name = "#{service_name}.#{case_name}" end |
Instance Attribute Details
#cmd ⇒ Object (readonly)
Returns the value of attribute cmd.
10 11 12 |
# File 'lib/generators/service/install/templates/services/case_base.rb', line 10 def cmd @cmd end |
#issuer ⇒ Object (readonly)
Returns the value of attribute issuer.
10 11 12 |
# File 'lib/generators/service/install/templates/services/case_base.rb', line 10 def issuer @issuer end |
#right_name ⇒ Object (readonly)
Returns the value of attribute right_name.
10 11 12 |
# File 'lib/generators/service/install/templates/services/case_base.rb', line 10 def right_name @right_name end |
Instance Method Details
#allowed? ⇒ Boolean
27 28 29 |
# File 'lib/generators/service/install/templates/services/case_base.rb', line 27 def allowed? true end |
#case_name ⇒ Object
19 20 21 |
# File 'lib/generators/service/install/templates/services/case_base.rb', line 19 def case_name self.class.name.split('::').last.downcase end |
#rollback ⇒ Object
31 |
# File 'lib/generators/service/install/templates/services/case_base.rb', line 31 def rollback; end |
#service_name ⇒ Object
23 24 25 |
# File 'lib/generators/service/install/templates/services/case_base.rb', line 23 def service_name self.class.name.split('::').first.remove('Service').downcase end |