Class: Nephophobia::Util

Inherits:
Object
  • Object
show all
Defined in:
lib/nephophobia/util.rb

Class Method Summary collapse

Class Method Details

.coerce(obj) ⇒ Object

Wraps a Hash with an Array.

obj: The Object to be tested for wrapping.



8
9
10
# File 'lib/nephophobia/util.rb', line 8

def self.coerce obj
  (obj.is_a? Hash) ? [obj] : obj
end