I hereby claim:
- I am saturnflyer on github.
- I am saturnflyer (https://keybase.io/saturnflyer) on keybase.
- I have a public key ASDwc6NFkREQr6HNVxVL2w4gI0IykEnAZvZiIDU1yGL3ywo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
module N | |
def foo | |
puts "N: foo" | |
super | |
end | |
end | |
module O | |
def foo | |
puts "O: foo" |
class Something | |
def self.init(*init_args) | |
# this works but... | |
define_method(:initialize){|*args| | |
# arity is -1 | |
} | |
class_eval %Q< | |
def initialize(#{*init_args}) |
require 'json' | |
require 'casting' | |
module Names | |
def names | |
"names here" | |
end | |
end | |
module Secrets |
class Foo | |
def self.say | |
p "hello from Foo" | |
end | |
end | |
module Bar | |
def say | |
super | |
p "hello from Bar" |
module Foo1 | |
def self.bar | |
"Yolo" | |
end | |
end | |
"Foo1.bar => #{Foo1.bar}" # => "Foo1.bar => Yolo" | |
module Foo2 | |
def bar # !> previous definition of bar was here | |
"Yolo" |
module Namespace | |
class Manager | |
def initialize(namespace) | |
@managed = namespace | |
end | |
def create_module(name, &block) | |
mod = Module.new(&block) | |
@managed.const_set(name, mod) | |
mod |
class Exception | |
def cause_message | |
cause && cause.message | |
end | |
def cause_backtrace | |
cause && cause.backtrace | |
end | |
end |
Introduction .....................................................................................................6 | |
What This Is ..................................................................................................................8 | |
What This Is Not ...........................................................................................................8 | |
Lost In Translation...........................................................................................9 | |
Our First Bugs..............................................................................................................10 | |
Object Orientation ........................................................................................12 | |
Where We Are..............................................................................................................12 | |
Where We’ve Been .......................................................................................................20 | |
Where We’re Going .................... |
require 'delegate' | |
# Public: This class initializes a presenter object. | |
# The presenter wraps a given object and a view object and will forward | |
# method calls to each. By default, any unknown method will be passed | |
# to the first object. | |
# Any methods that need to be sent to the view, may be done explicitly. | |
# | |
# Examples: | |
# | |
# # Inside a controller you create a helper method to access this object |