Is there a way to set a default initialize method without writing it down?
class DataClass
attr_accessor :title, :description, :childs
def hasChilds?
@childs.nil?
end
end
I Want to initialize this class with standard initial attributes. Something like this:
$> a = DataClass.new(:title => "adsf", :description => "test")
$> a.title # --> "asdf"
Is there such a solution?