Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save zotherstupidguy/8a8df04b1c9810d9bfb9ac4ff39c40fa to your computer and use it in GitHub Desktop.

Select an option

Save zotherstupidguy/8a8df04b1c9810d9bfb9ac4ff39c40fa to your computer and use it in GitHub Desktop.
building frameworks
module SSD
def self.included base
base.send :include, InstanceMethods
base.extend ClassMethods
end
module InstanceMethods
def print
p "hello world from SSD"
end
end
module ClassMethods
def mass
p "this is mass print"
end
end
end
class Framework
def self.inherited(model)
model.send :include, SSD
model.extend SSD
end end
class App < Framework
end
app = App.new
app.print
App.mass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment