class Eatr::TransformationSet

Public Class Methods

new(transformations) click to toggle source
# File lib/eatr/transformation_set.rb, line 5
def initialize(transformations)
  @transformations = transformations
end

Public Instance Methods

each() { |t| ... } click to toggle source
# File lib/eatr/transformation_set.rb, line 9
def each
  to_a.each do |t|
    yield t
  end
end
to_a() click to toggle source
# File lib/eatr/transformation_set.rb, line 15
def to_a
  @transformations.map do |t|
    const = Object.const_get(t.fetch('class'))

    if t['args']
      const.new(t['args'])
    else
      const.new
    end
  end
end