Sha256: da839069248870bfe2222c78a267d419bf5040ab282612c4f72f2f380ac691d4

Contents?: true

Size: 383 Bytes

Versions: 10

Compression:

Stored size: 383 Bytes

Contents

module ChartMogul
  module ConfigAttributes
    def config_accessor(attribute)
      define_method(attribute) do
        attr = config.send(attribute)
        raise ConfigurationError.new("Configuration for #{attribute} not set") if attr.nil?
        attr
      end

      define_method("#{attribute}=") do |val|
        config.send("#{attribute}=", val)
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
chartmogul-ruby-1.1.3 lib/chartmogul/config_attributes.rb
chartmogul-ruby-1.1.1 lib/chartmogul/config_attributes.rb
chartmogul-ruby-1.1.0 lib/chartmogul/config_attributes.rb
chartmogul-ruby-1.0.2 lib/chartmogul/config_attributes.rb
chartmogul-ruby-1.0.1 lib/chartmogul/config_attributes.rb
chartmogul-ruby-1.0.0 lib/chartmogul/config_attributes.rb
chartmogul-ruby-0.1.4 lib/chartmogul/config_attributes.rb
chartmogul-ruby-0.1.3 lib/chartmogul/config_attributes.rb
chartmogul-ruby-0.1.2 lib/chartmogul/config_attributes.rb
chartmogul-ruby-0.1.1 lib/chartmogul/config_attributes.rb