lib/hawatel_ps/linux/proc_info.rb
# Make attributes of public.
# Access  to process attribute from an object instance by public method where names of attributes are methods.
# @example
#   p = ProcInfo.new(proc_attrs)
#   puts p.processid
Make attributes of public.
Access  to process attribute from an object instance by public method where names of attributes are methods.
Make attributes of public . Access to process attribute from an object instance by public method where names of attributes are methods .
def define_attributes(hash)
        hash.each_pair do |key, value|
          metaclasses.send(:attr_reader, key.to_sym)
          instance_variable_set("@#{key}", value)
        end
      end
def define_attributes ( hash ) hash . each_pair do | key , value | metaclasses . send ( :attr_reader , key . to_sym ) instance_variable_set ( "@#{key}" , value ) end end
Make attributes of public.
Make attributes of public .
hash
example
p = ProcInfo.new(proc_attrs) puts p.processid
p = ProcInfo . new ( proc_attrs ) puts p . processid