Skip to content

Instantly share code, notes, and snippets.

@eladmeidar
Created February 6, 2014 14:11
Show Gist options
  • Save eladmeidar/8844876 to your computer and use it in GitHub Desktop.
Save eladmeidar/8844876 to your computer and use it in GitHub Desktop.
class Student
class Config
attr_accesor :name, :age, :iq
end
def Student.config(&block)
@config = Student::Config.new
yield block(@config)
true
end
end
Student.config do |configuration|
configuration.name = "Elad"
configuration.age = 12
configuration.iq = 3
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment