Sha256: d22c8a0b2f5a78925fcc2f65606d9740eb6bb55450cb9ddfac69c647b142c88a
Contents?: true
Size: 717 Bytes
Versions: 2
Compression:
Stored size: 717 Bytes
Contents
module JsonVoorhees class EngineCreateSerializerGenerator < Rails::Generators::Base source_root File.expand_path('../templates', __FILE__) argument :module_name, :type => :string argument :resource_name, :type => :string def sprint template "serializer.rb.erb", "app/serializers/#{module_name.underscore}/#{resource_singular}_serializer.rb" end private def resource_singular resource_name.underscore.singularize end def resource_plural resource_name.underscore.pluralize end def resource_camel resource_name.camelize.singularize end def module_camel module_name.camelize end def module_snake module_name.underscore.downcase end end end
Version data entries
2 entries across 2 versions & 1 rubygems