Module: Yardstick::Measurable::ClassMethods
- Included in:
- Yardstick::Measurable
- Defined in:
- lib/yardstick/measurable.rb
Instance Method Summary collapse
-
#included(mod) ⇒ undefined
private
Include the class or module with measurable class methods.
-
#rule(description) { ... } ⇒ undefined
private
Set the description for the rule.
-
#rules ⇒ Yardstick::RuleSet<Rule>
private
List of rules for this class.
Instance Method Details
#included(mod) ⇒ undefined
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Include the class or module with measurable class methods
17 18 19 |
# File 'lib/yardstick/measurable.rb', line 17 def included(mod) mod.extend(ClassMethods).rules.merge(rules) end |
#rule(description) { ... } ⇒ undefined
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Set the description for the rule
45 46 47 |
# File 'lib/yardstick/measurable.rb', line 45 def rule(description, &block) rules << Rule.new(description, &block) end |
#rules ⇒ Yardstick::RuleSet<Rule>
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
List of rules for this class
27 28 29 |
# File 'lib/yardstick/measurable.rb', line 27 def rules @rules ||= RuleSet.new end |