Skip to content

Instantly share code, notes, and snippets.

@macobo
Created October 17, 2018 17:48
Show Gist options
  • Select an option

  • Save macobo/9ef4fe2d42119e667cc4fb8d887bf090 to your computer and use it in GitHub Desktop.

Select an option

Save macobo/9ef4fe2d42119e667cc4fb8d887bf090 to your computer and use it in GitHub Desktop.
module MyExtendedMixin
def setter(x)
@var = x
end
def getter
@var || super
end
end
# On the other end
class Foo
extends MyExtendedMixin
end
# Real context: want to build a wrapper around prepend_view_path and controller_path in rails due to
# using a different folder layout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment