Sha256: 4445573f00d43778b0da32cdd68bd139f2803cf734bebfd972bf3829af77489c

Contents?: true

Size: 560 Bytes

Versions: 9

Compression:

Stored size: 560 Bytes

Contents

# encoding: UTF-8

module Rivet
  class ConfigProxy < BasicObject

    def initialize(config)
      @config = config
    end

    def send(m, *args)
      if @config.respond_to?("normalize_#{m}".to_sym)
        @config.send("normalize_#{m}".to_sym)
      else
        super
      end
    end

    def method_missing(m, *args, &block)
      if @config.respond_to?("normalize_#{m}".to_sym)
        @config.send("normalize_#{m}".to_sym)
      elsif @config.respond_to? m
        @config.send(m, *args, &block)
      else
        super
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
rivet-3.2.0 lib/rivet/common/config_proxy.rb
rivet-3.1.0 lib/rivet/common/config_proxy.rb
rivet-3.0.5 lib/rivet/common/config_proxy.rb
rivet-3.0.4 lib/rivet/common/config_proxy.rb
rivet-3.0.3 lib/rivet/common/config_proxy.rb
rivet-3.0.2 lib/rivet/common/config_proxy.rb
rivet-3.0.1 lib/rivet/common/config_proxy.rb
rivet-3.0.0 lib/rivet/common/config_proxy.rb
rivet-2.0.0 lib/rivet/config_proxy.rb