Sha256: 10222bd8bb4b20bb28dab34afaee529ab9c7951a1bbfa2372f4dc95026d19c17

Contents?: true

Size: 381 Bytes

Versions: 3

Compression:

Stored size: 381 Bytes

Contents

module <%= app_name.classify %>
  module Entities
    module <%= entity_name.classify.pluralize %>
      class <%= class_name %> < Grape::Entity
        <% fields.to_a.each do |field| %>
          <% attribute, type = field.split(':')%>
          expose :<%= attribute %>, documentation: { type: '<%= type %>', desc: '', example: '' }
        <% end %>
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
grape-transformations-0.0.5 lib/grape/generators/templates/entity.rb
grape-transformations-0.0.4 lib/grape/generators/templates/entity.rb
grape-transformations-0.0.3 lib/grape/generators/templates/entity.rb