Is there a good way to chain methods conditionally in Ruby?
What I want to do functionally is
if a && b && c my_object.some_method_b
You can use tap:
tap
my_object.tap{|o|o.method_a if a}.tap{|o|o.method_b if b}.tap{|o|o.method_c if c}