Sha256: d3ffa51e6b44e5bf7c02ade69973d2de9ddd056a299bd53d75ce3c93f212574c

Contents?: true

Size: 594 Bytes

Versions: 23

Compression:

Stored size: 594 Bytes

Contents

module Runby
  # Base class for all run types
  class RunType
    def description
      'No description'
    end

    def lookup_pace(five_k_time, distance_units = :km)
    end
  end

  # Extends RunTypes with additional methods.
  # Since RunTypes is autogenerated in all_run_types.g.rb, we needed a safe way of adding behavior to it
  #  without complicating the codegen.
  module RunTypes
    # Returns an initialized run type, given the name of an existing run type
    def self.new_from_name(run_type_name)
      Object.const_get("Runby::RunTypes::#{run_type_name}").new
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
runby_pace-0.6.119 lib/runby_pace/run_type.rb
runby_pace-0.6.118 lib/runby_pace/run_type.rb
runby_pace-0.6.117 lib/runby_pace/run_type.rb
runby_pace-0.6.116 lib/runby_pace/run_type.rb
runby_pace-0.6.115 lib/runby_pace/run_type.rb
runby_pace-0.6.114 lib/runby_pace/run_type.rb
runby_pace-0.6.113 lib/runby_pace/run_type.rb
runby_pace-0.6.112 lib/runby_pace/run_type.rb
runby_pace-0.6.111 lib/runby_pace/run_type.rb
runby_pace-0.6.110 lib/runby_pace/run_type.rb
runby_pace-0.6.109 lib/runby_pace/run_type.rb
runby_pace-0.6.108 lib/runby_pace/run_type.rb
runby_pace-0.6.106 lib/runby_pace/run_type.rb
runby_pace-0.6.105 lib/runby_pace/run_type.rb
runby_pace-0.6.104 lib/runby_pace/run_type.rb
runby_pace-0.6.103 lib/runby_pace/run_type.rb
runby_pace-0.6.102 lib/runby_pace/run_type.rb
runby_pace-0.6.101 lib/runby_pace/run_type.rb
runby_pace-0.6.100 lib/runby_pace/run_type.rb
runby_pace-0.6.98 lib/runby_pace/run_type.rb