Sha256: 4dc759c3a1111e5c1a1140a1ddb82fd5f25eebf24c5204966c16c9502130dc8a

Contents?: true

Size: 539 Bytes

Versions: 55

Compression:

Stored size: 539 Bytes

Contents

module RubyApp

  module Mixins

    module ConfigureMixin
      require 'ruby_app/configuration'

      def configure

        name = self.is_a?(Class) ? self.to_s : self.class.to_s
        name.gsub!(/([A-Z]+)([A-Z][a-z])/,'\1_\2')
        name.gsub!(/([a-z\d])([A-Z])/,'\1_\2')
        name.tr!("-", "_")
        name.downcase!

        names = name.split('::')

        value = RubyApp::Configuration.document
        names.each do |name|
          value = value[name]
        end

        return value

      end

    end

  end

end

Version data entries

55 entries across 55 versions & 1 rubygems

Version Path
RubyApp-0.0.76 lib/ruby_app/mixins/configure_mixin.rb
RubyApp-0.0.75 lib/ruby_app/mixins/configure_mixin.rb
RubyApp-0.0.74 lib/ruby_app/mixins/configure_mixin.rb
RubyApp-0.0.73 lib/ruby_app/mixins/configure_mixin.rb
RubyApp-0.0.72 lib/ruby_app/mixins/configure_mixin.rb
RubyApp-0.0.71 lib/ruby_app/mixins/configure_mixin.rb
RubyApp-0.0.70 lib/ruby_app/mixins/configure_mixin.rb
RubyApp-0.0.69 lib/ruby_app/mixins/configure_mixin.rb
RubyApp-0.0.68 lib/ruby_app/mixins/configure_mixin.rb
RubyApp-0.0.64 lib/ruby_app/mixins/configure_mixin.rb
RubyApp-0.0.63 lib/ruby_app/mixins/configure_mixin.rb
RubyApp-0.0.62 lib/ruby_app/mixins/configure_mixin.rb
RubyApp-0.0.61 lib/ruby_app/mixins/configure_mixin.rb
RubyApp-0.0.60 lib/ruby_app/mixins/configure_mixin.rb
RubyApp-0.0.59 lib/ruby_app/mixins/configure_mixin.rb
RubyApp-0.0.58 lib/ruby_app/mixins/configure_mixin.rb
RubyApp-0.0.57 lib/ruby_app/mixins/configure_mixin.rb
RubyApp-0.0.56 lib/ruby_app/mixins/configure_mixin.rb
RubyApp-0.0.55 lib/ruby_app/mixins/configure_mixin.rb
RubyApp-0.0.54 lib/ruby_app/mixins/configure_mixin.rb