From: "Alex S." Date: 2012-07-16T16:04:25+09:00 Subject: Newbie questions on the meanings of things in Ruby Hi, I am tasked with the development of puppet provider. I am a few days into Ruby and looking at the existing providers I am finding it hard to interpret - I went over Ruby pargprog book and I am still not sure what the following syntax means. I was hoping someone might be kind enough to guide me through the terms here. This is the code fragment I am struggling to understand: Puppet::Type.type(:file).provide :posix do desc "Uses POSIX functionality to manage file ownership and permissions." confine :feature => :posix include Puppet::Util::POSIX include Puppet::Util::Warnings require 'etc' def uid2name(id) return id.to_s if id.is_a?(Symbol) or id.is_a?(String) return nil if id > Puppet[:maximum_uid].to_i begin user = Etc.getpwuid(id) rescue TypeError, ArgumentError return nil end if user.uid == "" return nil else return user.name end end .... end In particular I am finding it hard to understand what the first line means - Puppet::Type.type(:file).provide :posix do ? Is this some sort of dynamic class (Type) extension? If so is there a resource I can go to dig up a bit more on this? Thanks, Alex. -- Posted via http://www.ruby-forum.com/.