Module: Pippi::Checks::MapFollowedByFlatten::MyMap

Defined in:
lib/pippi/checks/map_followed_by_flatten.rb

Instance Method Summary collapse

Instance Method Details

#map(&blk) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/pippi/checks/map_followed_by_flatten.rb', line 19

def map(&blk)
  result = super
  if self.class._pippi_check_map_followed_by_flatten.nil?
    # Ignore Array subclasses since map or flatten may have difference meanings
  else
    result.extend MyFlatten
    self.class._pippi_check_map_followed_by_flatten.mutator_methods.each do |this_means_its_ok_sym|
      result.define_singleton_method(this_means_its_ok_sym, self.class._pippi_check_map_followed_by_flatten.its_ok_watcher_proc(MyFlatten, :flatten))
    end
  end
  result
end