Class: ApiMaker::JsMethodNamerService

Inherits:
ApplicationService show all
Defined in:
app/services/api_maker/js_method_namer_service.rb

Instance Method Summary collapse

Methods inherited from ApplicationService

#api_maker_json

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

#performObject



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