Class: WoopleTheme::Dashboard::PointsPresenter

Inherits:
ExplicitDelegator show all
Defined in:
app/presenters/woople_theme/dashboard/points_presenter.rb

Instance Method Summary collapse

Methods inherited from ExplicitDelegator

enforce_definitions, #enforced_methods, #ensure_defined, #initialize

Constructor Details

This class inherits a constructor from ExplicitDelegator

Instance Method Details

#percent_completeObject



8
9
10
11
12
# File 'app/presenters/woople_theme/dashboard/points_presenter.rb', line 8

def percent_complete
  return 100 if data.total.zero?

  ( (data.earned.to_f / data.total.to_f) * 100 ).round
end