diff --git a/lib/robjc/resources/asset_catalog_resource.rb b/lib/robjc/resources/asset_catalog_resource.rb index d91f8db..438d83a 100644 --- a/lib/robjc/resources/asset_catalog_resource.rb +++ b/lib/robjc/resources/asset_catalog_resource.rb @@ -9,20 +9,11 @@ def images @images ||= image_names end - def method_name(string) - components = string.split('-') - string = components.first.downcase - if components.length == 1 - string - else - components.each_with_index do |s, i| - next if i == 0 - string += s.capitalize - end - end - string + def method_name string + components = string.split "-" + [components.shift.downcase, *components.map(&:capitalize)].join end - + private def image_names