Imagine I have a class like this:
class A
attr_accessor :a
attr_accessor :b
def check
raise "a must meet some condition" if !condition(@a)
raise "b must meet some condition" if !condition(@b)
end
def do_some_work
check()
# more work here
end
def do_some_more_work
check()
# other work here
end
end
Is it bad practice to have the preconditions for the accessors inside another method, and not the current one?