Skip to content

Files

Latest commit

 

History

History
41 lines (27 loc) · 767 Bytes

Style-ObjectThen.md

File metadata and controls

41 lines (27 loc) · 767 Bytes

Pattern: Missing use of Object#yield_self/Object#then name

Issue: -

Description

This rule enforces the use of consistent method names Object#yield_self or Object#then.

Examples

EnforcedStyle: then (default)

# bad
obj.yield_self { |x| x.do_something }

# good
obj.then { |x| x.do_something }

EnforcedStyle: yield_self

# bad
obj.then { |x| x.do_something }

# good
obj.yield_self { |x| x.do_something }

Configurable attributes

Name Default value Configurable values
EnforcedStyle then then, yield_self

Further Reading