Module: Yardstick::Measurable::ClassMethods

Included in:
Yardstick::Measurable
Defined in:
lib/yardstick/measurable.rb

Instance Method Summary collapse

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

Parameters:

  • mod (Module)

    the module to include within

Returns:

  • (undefined)


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

Parameters:

  • description (#to_str)

    the rule description

Yields:

  • the rule to perform

Yield Returns:

  • (Boolean)

    return true if successful, false if not

Returns:

  • (undefined)


43
44
45
# File 'lib/yardstick/measurable.rb', line 43

def rule(description, &block)
  rules << Rule.new(description, &block)
end

#rulesYardstick::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

Returns:



25
26
27
# File 'lib/yardstick/measurable.rb', line 25

def rules
  @rules ||= RuleSet.new
end