Class: Array

Inherits:
Object
  • Object
show all
Defined in:
app/cyclid/monkey_patches.rb

Overview

Add a method to Array

Instance Method Summary collapse

Instance Method Details

#%(other) ⇒ Object

Interpolate the data in the ctx hash for each String & Hash item



26
27
28
29
30
31
32
33
34
35
36
# File 'app/cyclid/monkey_patches.rb', line 26

def %(other)
  map do |entry|
    if entry.is_a? Hash
      entry % other
    elsif entry.is_a? String
      entry ** other
    else
      entry
    end
  end
end