Class: Array

Inherits:
Object
  • Object
show all
Defined in:
lib/one_touch/models/array.rb

Instance Method Summary collapse

Instance Method Details

#each_relations_on(element, mark) ⇒ Object

return a Hash



4
5
6
7
8
9
# File 'lib/one_touch/models/array.rb', line 4

def each_relations_on(element,mark)
  select {|e| e != element }.inject({}) do |memo,record|
    memo.merge!({record => mark}) unless memo.keys.include? record
    memo
  end
end