Sha256: cdc4641ea416149d12e9316cb919b7bdbe8e0ee985b5ec3afd4cc19a4bd3911a
Contents?: true
Size: 1.42 KB
Versions: 4
Compression:
Stored size: 1.42 KB
Contents
# encoding: utf-8 module Yardstick module Measurable include Measurement::UtilityMethods module ClassMethods # Include the class or module with measurable class methods # # @param [Module] mod # the module to include within # # @return [undefined] # # @api private def included(mod) mod.extend(ClassMethods).rules.merge(rules) end # List of rules for this class # # @return [Yardstick::RuleSet<Rule>] # the rules for this class # # @api private def rules @rules ||= RuleSet.new end # Set the description for the rule # # @param [#to_str] description # the rule description # # @yield [] # the rule to perform # # @yieldreturn [Boolean] # return true if successful, false if not # # @return [undefined] # # @api private def rule(description, &block) rules << Rule.new(description, &block) end end # module ClassMethods extend ClassMethods # Return a list of measurements for this docstring instance # # @example # docstring.measure # => [ Measurement ] # # @return [Yardstick::MeasurementSet] # a collection of measurements # # @api public def measure self.class.rules.measure(self) end end # module Measurable end # module Yardstick
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
yardstick-0.9.6 | lib/yardstick/measurable.rb |
yardstick-0.9.5 | lib/yardstick/measurable.rb |
yardstick-0.9.4 | lib/yardstick/measurable.rb |
yardstick-0.9.3 | lib/yardstick/measurable.rb |