lib/grape/generators/templates/entity.rb in grape-transformations-0.0.2 vs lib/grape/generators/templates/entity.rb in grape-transformations-0.0.3
- old
+ new
@@ -1,11 +1,11 @@
module <%= app_name.classify %>
module Entities
module <%= entity_name.classify.pluralize %>
- class Default < Grape::Entity
- <% fields.each do |field| %>
+ class <%= class_name %> < Grape::Entity
+ <% fields.to_a.each do |field| %>
<% attribute, type = field.split(':')%>
- expose :<%= attribute %>, documentation: { type: '<%= type %>', desc: 'write a description here', example: 'write an example here' }
+ expose :<%= attribute %>, documentation: { type: '<%= type %>', desc: '', example: '' }
<% end %>
end
end
end
end