Sha256: 245fcbb363dddf2e0ea47825b8574969220a6e9b7a95e7b25e03b4ededfb0944

Contents?: true

Size: 564 Bytes

Versions: 20

Compression:

Stored size: 564 Bytes

Contents

module ConfigBuilder
  module ModelDelegator

    def model_delegators
      self.class.model_delegators
    end

    def eval_models(config)
      model_delegators.each do |model|
        meth = "eval_#{model}"
        send(meth, config)
      end
    end

    def self.included(klass)
      klass.extend ClassMethods
    end

    module ClassMethods
      def def_model_delegator(identifier)
        def_model_attribute(identifier)
        model_delegators << identifier
      end

      def model_delegators
        (@models ||= [])
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 2 rubygems

Version Path
vagrant-config_builder-0.15.1 lib/config_builder/model_delegator.rb
vagrant-config_builder-0.15.0 lib/config_builder/model_delegator.rb
vagrant-config_builder-0.14.0 lib/config_builder/model_delegator.rb
vagrant-config_builder-0.13.0 lib/config_builder/model_delegator.rb
vagrant-masonry-0.13.0 lib/config_builder/model_delegator.rb
vagrant-config_builder-0.12.0 lib/config_builder/model_delegator.rb
vagrant-config_builder-0.11.0 lib/config_builder/model_delegator.rb
vagrant-config_builder-0.10.1 lib/config_builder/model_delegator.rb
vagrant-config_builder-0.10.0 lib/config_builder/model_delegator.rb
vagrant-config_builder-0.9.0 lib/config_builder/model_delegator.rb
vagrant-config_builder-0.8.0 lib/config_builder/model_delegator.rb
vagrant-config_builder-0.7.1 lib/config_builder/model_delegator.rb
vagrant-config_builder-0.7.0 lib/config_builder/model_delegator.rb
vagrant-config_builder-0.6.0 lib/config_builder/model_delegator.rb
vagrant-config_builder-0.5.0 lib/config_builder/model_delegator.rb
vagrant-config_builder-0.4.0 lib/config_builder/model_delegator.rb
vagrant-config_builder-0.3.1 lib/config_builder/model_delegator.rb
vagrant-config_builder-0.3.0 lib/config_builder/model_delegator.rb
vagrant-config_builder-0.2.0 lib/config_builder/model_delegator.rb
vagrant-config_builder-0.1.0 lib/config_builder/model_delegator.rb