Sha256: 198e3969b5e0d10e30315803881982a883f48e0ac6a5a8c9b72a009d5f6b5014

Contents?: true

Size: 1.02 KB

Versions: 7

Compression:

Stored size: 1.02 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')
    
    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
      end
      
    end
    
    
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
joshbuddy-usher-0.5.2 lib/usher/interface.rb
joshbuddy-usher-0.5.3 lib/usher/interface.rb
joshbuddy-usher-0.5.4 lib/usher/interface.rb
usher-0.5.4 lib/usher/interface.rb
usher-0.5.3 lib/usher/interface.rb
usher-0.5.2 lib/usher/interface.rb
usher-0.5.1 lib/usher/interface.rb