Class: AuditPresenter

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
app/presenters/audit_presenter.rb

Instance Method Summary collapse

Constructor Details

#initialize(audit, expand: false) ⇒ AuditPresenter

Returns a new instance of AuditPresenter


6
7
8
9
# File 'app/presenters/audit_presenter.rb', line 6

def initialize(audit, expand: false)
  @audit = audit
  @expand = expand
end

Instance Method Details

#expand?Boolean

Returns:

  • (Boolean)

11
12
13
# File 'app/presenters/audit_presenter.rb', line 11

def expand?
  @expand
end

#failuresObject


19
20
21
# File 'app/presenters/audit_presenter.rb', line 19

def failures
  audit.events.where(outcome: "failure")
end

#successesObject


15
16
17
# File 'app/presenters/audit_presenter.rb', line 15

def successes
  audit.events.where(outcome: "success")
end