Sha256: 8197be43c14b3b3b3ab9606a660bfd80cde2470e01e14565fc143da2f24fa9d2

Contents?: true

Size: 610 Bytes

Versions: 4

Compression:

Stored size: 610 Bytes

Contents

module Rails
  module MetaTags
    class Config
      PROPERTIES.each do |t|
        class_eval "def #{t}(val = nil, &block); self[:#{t}] = val || block; end"
        class_eval "def #{t}=(val); self[:#{t}] = val; end"
      end

      def initialize(data = nil)
        @data = data || {}
        @instances = {}
      end

      def configure_via_block(block)
        instance_eval(&block)
      end      
    
      def [](tag)
        @data[tag.to_sym]
      end
    
      def []=(tag, value)
        @data[tag.to_sym] = value
      end
    
      def to_hash
        @data.dup
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rails_meta_tags-0.3.2 lib/rails/meta_tags/config.rb
rails_meta_tags-0.3.1 lib/rails/meta_tags/config.rb
rails_meta_tags-0.2.9 lib/rails/meta_tags/config.rb
rails_meta_tags-0.2.8 lib/rails/meta_tags/config.rb