Class: ApiMaker::IncludeHelpers
- Inherits:
-
ApplicationService
- Object
- ServicePattern::Service
- ApplicationService
- ApiMaker::IncludeHelpers
- Defined in:
- app/services/api_maker/include_helpers.rb
Instance Attribute Summary collapse
-
#klass ⇒ Object
readonly
Returns the value of attribute klass.
Instance Method Summary collapse
-
#initialize(klass:) ⇒ IncludeHelpers
constructor
A new instance of IncludeHelpers.
- #perform ⇒ Object
Methods inherited from ApplicationService
Constructor Details
#initialize(klass:) ⇒ IncludeHelpers
Returns a new instance of IncludeHelpers.
6 7 8 |
# File 'app/services/api_maker/include_helpers.rb', line 6 def initialize(klass:) @klass = klass end |
Instance Attribute Details
#klass ⇒ Object (readonly)
Returns the value of attribute klass.
4 5 6 |
# File 'app/services/api_maker/include_helpers.rb', line 4 def klass @klass end |
Instance Method Details
#perform ⇒ Object
10 11 12 13 14 15 16 |
# File 'app/services/api_maker/include_helpers.rb', line 10 def perform ::ApiHelpers.constants(false).each do |constant| klass.include ApiHelpers.const_get(constant) end succeed! end |