This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module M | |
| def method | |
| puts "hello" | |
| end | |
| end | |
| def execute(current_module, &block) | |
| Object.new.tap do |o| | |
| o.extend(current_module) | |
| o.instance_eval &block |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # muzang.rb | |
| require 'muzang' | |
| require 'muzang-plugins' | |
| class Bshellz | |
| include Muzang::Plugins::Helpers | |
| def initialize(bot) | |
| @bot = bot | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module MyModule | |
| def method | |
| puts "method" | |
| end | |
| end | |
| class MyClass | |
| include MyModule | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module BeerDrinkerRole | |
| def drink | |
| end | |
| end | |
| class BeerDrinker | |
| include BeerDrinkerRole | |
| end | |
| module AnotherRole |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module M | |
| def self.included(base) | |
| self.instance_methods.each do |method| | |
| alias_method "#{self.to_s}_#{method}".to_sym, method.to_sym | |
| end | |
| end | |
| def hello | |
| 1 | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/lib/geokit/geocoders.rb b/lib/geokit/geocoders.rb | |
| index c407141..c9f457c 100644 | |
| --- a/lib/geokit/geocoders.rb | |
| +++ b/lib/geokit/geocoders.rb | |
| @@ -83,7 +83,7 @@ module Geokit | |
| def self.__define_accessors | |
| class_variables.each do |v| | |
| - sym = v.to_s.delete("@").to_sym | |
| + sym = v.delete("@").to_sym |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module MethodModule | |
| def methoda(*args) | |
| return args | |
| end | |
| end | |
| class MyClass | |
| include MethodModule | |
| def methoda(*) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| source :rubygems | |
| gem "muzang", "~> 1.0.0" | |
| gem "muzang-plugins", "~> 1.0.0" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| scope :example_scope, where(:invited => true) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Object | |
| def self.define_method(*args) | |
| "fuck it" | |
| end | |
| end | |
| foo = Class.new(ExampleClass) do | |
| def bar | |
| puts "bar" | |
| end |