Created
August 25, 2014 14:27
-
-
Save sesharim/0ccf1d59dcfd61c6e64b to your computer and use it in GitHub Desktop.
block on initialize
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 Gladiator | |
attr_accessor :name, :rank, :height, :weight | |
def initialize | |
yield(self) | |
end | |
end | |
spartak = Gladiator.new do |his| | |
his.name = "spartak" | |
his.weight = 91 | |
his.rank = :chempion | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment