Class: RevisionPresenter

Inherits:
BasePresenter show all
Defined in:
app/presenters/revision_presenter.rb

Instance Method Summary collapse

Methods inherited from BasePresenter

inherited, #initialize, #to_model, use_presenters

Constructor Details

This class inherits a constructor from BasePresenter

Instance Method Details

#tag_uid(short = true, count = 10) ⇒ Object


12
13
14
15
16
17
18
19
# File 'app/presenters/revision_presenter.rb', line 12

def tag_uid(short = true, count = 10)
  return unless revision.tag_uid
  if short && revision.tag_uid.size > 10
    revision.tag_uid[0...count] + '...'
  else
    revision.tag_uid
  end
end

#uid(short = true) ⇒ Object


8
9
10
# File 'app/presenters/revision_presenter.rb', line 8

def uid(short = true)
  short ? revision.uid[0..7] : revision.uid
end