Moved get_input_type to protected section.
Modified metadata method to ensure that the Ruby hash creation is done only once.
Added file? method.