class Os @@os_bit @@m_os def initialize self.m_os self.os_bit end def m_os @@m_os = `egrep -i 'red\ hat|suse|centos|ubuntu|debian' /etc/issue` @@m_os end def os_bit @@os_bit = `uname -m` if @@os_bit == "x86_64" @@os_bit = "64bit" else @@os_bit == "32bit" end end def parse $return_data = { 'os_bit' => @@os_bit, 'm_os' => @@m_os } end end a = Os.new puts a.m_os