class CreatePost module RequestInterface # Interface specification for request objects that are used to initialize the create_post interactor # build on the general interface extend Interface # any request object must have a title method and it must return an instance of String def title if defined?(super) value = super raise Interface::InvalidReturn unless value.is_a? String value else raise Interface::MissingMethod end end end end