Sha256: 42cc9e7e4e24f1bc57a02bbd26b0ddf9ffb54f814cd80442520761c13c1b880e

Contents?: true

Size: 642 Bytes

Versions: 14

Compression:

Stored size: 642 Bytes

Contents

class TestingNotePresenter
  include AvatarHelper

  def initialize(testing_notes)
    @testing_notes = testing_notes
  end

  def as_json(*args)
    if @testing_notes.is_a?(TestingNote)
      to_hash @testing_notes
    else
      @testing_notes.map(&method(:to_hash))
    end
  end

  def to_hash(testing_note)
    { id: testing_note.id,
      createdAt: testing_note.created_at,
      avatarImage: avatar_for(testing_note.user),
      userId: testing_note.user_id,
      byTester: testing_note.user.try(:tester?),
      ticketId: testing_note.ticket_id,
      verdict: testing_note.verdict,
      comment: testing_note.comment }
  end

end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
houston-core-0.7.0.beta3 app/presenters/testing_note_presenter.rb
houston-core-0.7.0.beta2 app/presenters/testing_note_presenter.rb
houston-core-0.7.0.beta app/presenters/testing_note_presenter.rb
houston-core-0.6.3 app/presenters/testing_note_presenter.rb
houston-core-0.6.2 app/presenters/testing_note_presenter.rb
houston-core-0.6.1 app/presenters/testing_note_presenter.rb
houston-core-0.6.0 app/presenters/testing_note_presenter.rb
houston-core-0.5.6 app/presenters/testing_note_presenter.rb
houston-core-0.5.5 app/presenters/testing_note_presenter.rb
houston-core-0.5.4 app/presenters/testing_note_presenter.rb
houston-core-0.5.3 app/presenters/testing_note_presenter.rb
houston-core-0.5.2 app/presenters/testing_note_presenter.rb
houston-core-0.5.1 app/presenters/testing_note_presenter.rb
houston-core-0.5.0 app/presenters/testing_note_presenter.rb