Created
August 12, 2014 19:42
-
-
Save d3vkit/33b9e7c720ca11de8634 to your computer and use it in GitHub Desktop.
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
class Folder | |
include ClosedFolder, OpenFolder | |
def initialize(name) | |
@name = name | |
@folder_state = ClosedFolder.new | |
end | |
def pretty_name | |
@folder_state.pretty_name | |
end | |
def left_click | |
@folder_state = @folder_state.left_click | |
end | |
end | |
module ClosedFolder | |
def pretty_name | |
end | |
def left_click | |
# do work | |
OpenFolder.new #damn it we can't access this can we? Or does it work because it's included in the class? | |
end | |
end | |
module OpenFolder | |
def pretty_name | |
end | |
def left_click | |
# do work | |
ClosedFolder.new | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment