Module: Relaton::Core::ArrayWrapper

Defined in:
lib/relaton/core/array_wrapper.rb

Instance Method Summary collapse

Instance Method Details

#array(content) ⇒ Array<Object>

Wrap into Array if not Array

Parameters:

  • content (Object)

Returns:

  • (Array<Object>)


11
12
13
14
15
16
17
# File 'lib/relaton/core/array_wrapper.rb', line 11

def array(content)
  case content
  when Array then content
  when nil then []
  else [content]
  end
end