Class: Array

Inherits:
Object show all
Defined in:
lib/has_many_polymorphs/support_methods.rb

Instance Method Summary collapse

Instance Method Details

#_extract_options!Object



39
40
41
# File 'lib/has_many_polymorphs/support_methods.rb', line 39

def _extract_options!
  last.is_a?(::Hash) ? pop : {}
end

#_flatten_onceObject

Flattens the first level of self.



34
35
36
# File 'lib/has_many_polymorphs/support_methods.rb', line 34

def _flatten_once
  self.inject([]){|r, el| r + Array(el)}
end