Sha256: 62e1dbb14caa75bace587d4fde9e65b5d4b24808d59186fbac343c42c7d36733
Contents?: true
Size: 1.71 KB
Versions: 1
Compression:
Stored size: 1.71 KB
Contents
module Yardstick module Measurable include Measurement::UtilityMethods module ClassMethods # 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 private # 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 # Extend the docstring meta class with measurable class methods # # @param [YARD::Docstring] docstring # the docstring to extend # # @return [undefined] # # @api private def extended(docstring) included(docstring.meta_class) 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 meta_class.rules.measure(self) end end # module Measurable end # module Yardstick
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
yardstick-0.6.0 | lib/yardstick/measurable.rb |