When I first started writing in ruby I found myself needing to know the ruby method equivalents to specific PHP functions. These methods are widely used by myself for debugging and day to day checking of data types.
PHP’s die(‘message’) becomes
PHP’s get_class_methods() becomes
PHP’s in_array() becomes
PHP’s key_exists() becomes
PHP’s isset() becomes
Nice and simple conversion. Moving from PHP to ruby takes little effort if you understand the basis of two things:
- Object Oriented Programming
- How to find out methods available on an object in Ruby