Aurimas N. wrote in post #1085124: > > I am trying to make method which would set getter, setter, default > value, and would check if attribute is filled in. > That makes no sense. You are going to have to learn enough ruby to be able to talk ruby. I suggest you read a beginning ruby book. > > Another method that replicates .new method which would take nokogiri doc > and would catch all attributes which are defined with first method and > get values. > Also nearly incomprehensible. > xml['name'] = "John" > lib = Library.newXML(xml) > lib.name > => "John" > Okay, I can see something in there. require 'delegate' class XML attr_accessor :name, :date end class Lib < SimpleDelegator end xml = XML.new xml.name = "John" lib = Lib.new(xml) puts lib.name --output:-- John > And the last method To take all atributes which are defined with the > first one... Complete jibberish. You need to learn some basic XML, too; so that you can speak XML as well. -- Posted via http://www.ruby-forum.com/.