- Dynamic Dispatch
- Dynamic Method
- Ghost Methods
- Dynamic Proxies
- Blank Slate
- Kernel Method
- Flattening the Scope (aka Nested Lexical Scopes)
- Context Probe
- Class Eval (not really a 'spell' more just a demonstration of its usage)
- Class Macros
This file contains 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
# ----- Common Linked List Methods ----- | |
def add_to_front(list, data) | |
build_list(data, list) | |
end | |
def add_to_back(list, data) | |
return build_list(data, empty_list) if empty?(list) | |
new_tail = add_to_back(tail(list), data) | |
build_list(head(list), new_tail) |
This file contains 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
require 'erb' | |
class Num | |
def initialize(num) | |
@n = num | |
end | |
end | |
# okay, some object we want to evaluate our ERB within, | |
# to do that we need a binding for it |