Created
November 25, 2015 23:16
-
-
Save cawel/5f5d8bc9ffe609551625 to your computer and use it in GitHub Desktop.
blog-quiz-intermediate-1b
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
#instance-specific behavior | |
puts "kind of Scrollable? #{pane.kind_of?(Scrollable)}" | |
pane.extend(Scrollable) | |
pane.scroll 3 | |
puts pane.position | |
puts "kind of Scrollable? #{pane.kind_of?(Scrollable)}" | |
#adding behavior to the class | |
class Pane | |
include Scrollable | |
end | |
pane = Pane.new "this is the content of a scrollable pane" | |
pane.scroll 5 | |
puts pane.position | |
puts "kind of Scrollable? #{pane.kind_of?(Scrollable)}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment