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
15 16 17 |
# File 'lib/yardstick/measurable.rb', line 15 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
43 44 45 |
# File 'lib/yardstick/measurable.rb', line 43 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
25 26 27 |
# File 'lib/yardstick/measurable.rb', line 25 def rules @rules ||= RuleSet.new end |