Sha256: 490f0f7c48fff111f06b291f64e13c0eed9eb8a5ecda08eb1009de1dc2a0b681

Contents?: true

Size: 366 Bytes

Versions: 2

Compression:

Stored size: 366 Bytes

Contents

class <%= class_name.pluralize %>Presenter < BasePresenter
  def initialize(<%= plural_name %>)
    @<%= plural_name %> = <%= plural_name %>
  end

  def build_many(*representations, **keyword_representations)
    @<%= plural_name %>.map do |exercise|
      <%= class_name %>Presenter.new(exercise).build(*representations, keyword_representations)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rails-api-controller-generator-0.1.1 lib/generators/api_controller/templates/array_presenter.rb
rails-api-controller-generator-0.1.0 lib/generators/api_controller/templates/array_presenter.rb