Sha256: 81345b787beff8538203bb1631c0295bf4aafdede44d9d6662431a2b6ed04a94

Contents?: true

Size: 426 Bytes

Versions: 4

Compression:

Stored size: 426 Bytes

Contents

module RailsTemplater
  class JavaScriptFramework
    
    DEFAULT = :jquery
    SUPPORTED_TYPES = [:jquery, :prototype]
    
    def type
      @type || DEFAULT 
    end
    
    def type=(value)
      raise NotSupportedError unless SUPPORTED_TYPES.include?(value)
      @type = value
    end
    
    SUPPORTED_TYPES.each do |type|
      define_method "#{type}?" do
        self.type == type
      end
    end
    
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rails_templater-0.2.1 lib/rails_templater/javascript_framework.rb
rails_templater-0.2.0 lib/rails_templater/javascript_framework.rb
rails_templater-0.1.2 lib/rails_templater/javascript_framework.rb
rails_templater-0.1.1 lib/rails_templater/javascript_framework.rb