class Intercept::DecoratorBuilder

Public Class Methods

from_hash(decorator) click to toggle source
# File lib/intercept/decorator_builder.rb, line 5
def self.from_hash(decorator)
  return unless decorator
  decorator_class = get_class(decorator[:name])
  decorator_class.new(decorator[:args])
end
get_class(symbol) click to toggle source
# File lib/intercept/decorator_builder.rb, line 11
def self.get_class(symbol)
  Object.const_get "Intercept::Decorator::#{symbol.to_s.split('_').map{ |w| w.capitalize }.join}"
end