lib/nike_plus/activity.rb
## Activity pace in minutes per mile.
Activity pace in minutes per mile.
Activity pace in minutes per mile .
def mpm
      mph = self.mph
      return nil unless mph and mph.is_a?(Float)
      div = 60.0 / mph
      min = div.floor
      sec = ( ( div - min ) * 60.0 )
      "#{ sprintf("%.2d", min ) }:#{ sprintf("%.2d", sec ) }"
    end
def mpm mph = self . mph return nil unless mph and mph . is_a? ( Float ) div = 60.0 / mph min = div . floor sec = ( ( div - min ) * 60.0 ) "#{ sprintf("%.2d", min ) }:#{ sprintf("%.2d", sec ) }" end
Activity pace in minutes per mile.
Activity pace in minutes per mile .