Sha256: 14824debc739d782bfc351a30f9b37ff99175352ac68eaf6eb4788cfff0fe783

Contents?: true

Size: 333 Bytes

Versions: 1

Compression:

Stored size: 333 Bytes

Contents

require 'explicit_delegator'

module WoopleTheme
  module Dashboard
    class PointsPresenter < ExplicitDelegator
      enforce_definitions :earned, :total

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

      private

      def data
        __getobj__
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
woople-theme-0.5.14 app/presenters/woople_theme/dashboard/points_presenter.rb