Sha256: 43fdbbaea421b6536cdff24cf6c087625d0352998140d6d7e7d0320b640270a2

Contents?: true

Size: 1.15 KB

Versions: 3

Compression:

Stored size: 1.15 KB

Contents

class Usher
  module Interface
    autoload :Rails2_2Interface, File.join(File.dirname(__FILE__), 'interface', 'rails2_2_interface')
    autoload :Rails2_3Interface, File.join(File.dirname(__FILE__), 'interface', 'rails2_3_interface')
    autoload :MerbInterface, File.join(File.dirname(__FILE__), 'interface', 'merb_interface')
    autoload :RackInterface, File.join(File.dirname(__FILE__), 'interface', 'rack_interface')
    autoload :EmailInterface, File.join(File.dirname(__FILE__), 'interface', 'email_interface')
    autoload :Rails3Interface, File.join(File.dirname(__FILE__), 'interface', 'rails3_interface')
    autoload :TextInterface, File.join(File.dirname(__FILE__), 'interface', 'text_interface')
    
    def self.for(type, &blk)
      class_for(type).new(&blk)
    end
    
    def self.class_for(type)
      case type
      when :rails2_2
        Rails2_2Interface
      when :rails2_3
        Rails2_3Interface
      when :merb
        MerbInterface
      when :rack
        RackInterface
      when :email
        EmailInterface
      when :rails3
        Rails3Interface
      when :text
        TextInterface
      end
      
    end
    
    
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
joshbuddy-usher-0.5.6 lib/usher/interface.rb
usher-0.5.6 lib/usher/interface.rb
usher-0.5.5 lib/usher/interface.rb