Sha256: 4cad24b098afb750f1f11dbee7ef5d10a8e6e1510d98a59d9f371114e383f19e

Contents?: true

Size: 284 Bytes

Versions: 5

Compression:

Stored size: 284 Bytes

Contents

module Charger

  class LineItem::OnOff < LineItem
    attribute :enabled, Boolean

    # @return [Float]
    def total
      if enabled
        component.total_for(1)
      else
        0
      end
    end

    # @return [Boolean]
    def allocated?
      enabled
    end
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
charger-0.2.0 lib/charger/line_item/on_off.rb
charger-0.1.1 lib/charger/line_item/on_off.rb
charger-0.1.0 lib/charger/line_item/on_off.rb
charger-0.0.3 lib/charger/line_item/on_off.rb
charger-0.0.2 lib/charger/line_item/on_off.rb