Class: ApiMaker::JsMethodNamerService
- Inherits:
-
ApplicationService
- Object
- ServicePattern::Service
- ApplicationService
- ApiMaker::JsMethodNamerService
- Defined in:
- app/services/api_maker/js_method_namer_service.rb
Instance Method Summary collapse
-
#initialize(name:) ⇒ JsMethodNamerService
constructor
A new instance of JsMethodNamerService.
- #perform ⇒ Object
Methods inherited from ApplicationService
Constructor Details
#initialize(name:) ⇒ JsMethodNamerService
Returns a new instance of JsMethodNamerService.
2 3 4 |
# File 'app/services/api_maker/js_method_namer_service.rb', line 2 def initialize(name:) @name = name end |
Instance Method Details
#perform ⇒ Object
6 7 8 9 10 |
# File 'app/services/api_maker/js_method_namer_service.rb', line 6 def perform camelized = @name.to_s.camelize new_name = "#{camelized[0..0].downcase}#{camelized[1..camelized.length]}" ServicePattern::Response.new(result: new_name) end |