Method: Joey::RestAPI#map_to_class
- Defined in:
- lib/joey/rest_api.rb
#map_to_class(hash_or_array, klass) ⇒ Object
64 65 66 67 68 69 70 71 72 |
# File 'lib/joey/rest_api.rb', line 64 def map_to_class(hash_or_array, klass) return nil if hash_or_array.nil? if hash_or_array.kind_of?(Array) hash_or_array.map! {|elmnt| create_instance(klass, elmnt)} else hash_or_array = create_instance(klass, hash_or_array) end hash_or_array end |