Sha256: d58f0ad479faaaea8eb6484f731b8982863c104fad31d58b62792223cc29fca2

Contents?: true

Size: 648 Bytes

Versions: 12

Compression:

Stored size: 648 Bytes

Contents

# encoding: utf-8
module RailsBestPractices
  module Core
    class ModelAttributes
      def initialize
        @attributes = {}
      end

      def add_attribute(model_name, attribute_name, attribute_type)
        @attributes[model_name] ||= {}
        @attributes[model_name][attribute_name] = attribute_type
      end

      def get_attribute_type(model_name, attribute_name)
        @attributes[model_name] ||= {}
        @attributes[model_name][attribute_name]
      end

      def is_attribute?(model_name, attribute_name)
        @attributes[model_name] ||= {}
        !!@attributes[model_name][attribute_name]
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
rails_best_practices-1.1.0 lib/rails_best_practices/core/model_attributes.rb
rails_best_practices-1.0.1 lib/rails_best_practices/core/model_attributes.rb
rails_best_practices-1.0.0 lib/rails_best_practices/core/model_attributes.rb
rails_best_practices-0.10.1 lib/rails_best_practices/core/model_attributes.rb
rails_best_practices-0.10.0 lib/rails_best_practices/core/model_attributes.rb
rails_best_practices-raydog153-0.9.1 lib/rails_best_practices/core/model_attributes.rb
rails_best_practices-0.9.0 lib/rails_best_practices/core/model_attributes.rb
rails_best_practices-0.8.2 lib/rails_best_practices/core/model_attributes.rb
rails_best_practices-0.8.1 lib/rails_best_practices/core/model_attributes.rb
rails_best_practices-0.8.0 lib/rails_best_practices/core/model_attributes.rb
rails_best_practices-0.7.5 lib/rails_best_practices/core/model_attributes.rb
rails_best_practices-0.7.4 lib/rails_best_practices/core/model_attributes.rb