Last active
December 24, 2015 03:59
-
-
Save tooky/6740423 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
# Fill in the values after # => | |
# | |
$title = "Ruby Variables" | |
@subtitle = "Where do they come from?" | |
presenter = "@tooky" | |
class Presentation | |
@@length = "10 min" | |
@style = "Code" | |
def self.subtitle | |
@subtitle | |
end | |
def self.style | |
@style | |
end | |
def self.the_presenter | |
presenter = presenter || "https://github.com/tooky" | |
presenter | |
end | |
def self.length | |
@@length | |
end | |
def self.title | |
$title | |
end | |
def initialize(subtitle) | |
@subtitle = subtitle | |
end | |
def the_presenter | |
presenter = presenter || "Steve Tooke" | |
presenter | |
end | |
def style | |
@style | |
end | |
def length | |
@@length | |
end | |
def title | |
$title | |
end | |
end | |
class Talk < Presentation | |
@@length = "25 min" | |
@style = "Keynote" | |
end | |
a_presentation = Presentation.new("An instance has this effect.") | |
a_talk = Talk.new("What happens with inheritance?") | |
$title # => | |
@subtitle # => | |
presenter # => | |
@style # => | |
Presentation.style # => | |
Presentation.length # => | |
Presentation.the_presenter # => | |
Talk.style # => | |
Talk.length # => | |
Talk.the_presenter # => | |
a_presentation.style # => | |
a_presentation.length # => | |
a_presentation.the_presenter # => | |
a_talk.style # => | |
a_talk.length # => | |
a_talk.the_presenter # => |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment