Sha256: 0e84ea1fc04cb1b9b0710e7f61efc9c0fe4c9f0ee2d580219b0a8a7a25fe0064

Contents?: true

Size: 432 Bytes

Versions: 18

Compression:

Stored size: 432 Bytes

Contents

module LearnWeb
  module AttributePopulatable
    def self.included(base)
      base.class_eval do
        def populate_attributes!
          data.each do |attribute, value|
            if !self.respond_to?(attribute)
              self.class.class_eval do
                attr_accessor attribute
              end
            end

            self.send("#{attribute}=", value)
          end
        end
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
learn-web-1.5.5 lib/learn_web/attribute_populatable.rb
learn-web-1.5.4 lib/learn_web/attribute_populatable.rb
learn-web-1.5.3 lib/learn_web/attribute_populatable.rb
learn-web-1.5.2 lib/learn_web/attribute_populatable.rb
learn-web-1.5.1 lib/learn_web/attribute_populatable.rb
learn-web-1.5.0 lib/learn_web/attribute_populatable.rb
learn-web-1.4.2 lib/learn_web/attribute_populatable.rb
learn-web-1.4.1 lib/learn_web/attribute_populatable.rb
learn-web-1.4.0 lib/learn_web/attribute_populatable.rb
learn-web-1.3.0 lib/learn_web/attribute_populatable.rb
learn-web-1.2.0 lib/learn_web/attribute_populatable.rb
learn-web-1.1.0 lib/learn_web/attribute_populatable.rb
learn-web-1.0.5 lib/learn_web/attribute_populatable.rb
learn-web-1.0.4 lib/learn_web/attribute_populatable.rb
learn-web-1.0.3 lib/learn_web/attribute_populatable.rb
learn-web-1.0.2 lib/learn_web/attribute_populatable.rb
learn-web-1.0.1 lib/learn_web/attribute_populatable.rb
learn-web-1.0.0 lib/learn_web/attribute_populatable.rb