Module: Usher::Interface

Defined in:
lib/usher/interface.rb,
lib/usher/interface/merb_interface.rb,
lib/usher/interface/rack_interface.rb,
lib/usher/interface/text_interface.rb,
lib/usher/interface/email_interface.rb,
lib/usher/interface/rails3_interface.rb,
lib/usher/interface/rails2_2_interface.rb,
lib/usher/interface/rails2_3_interface.rb,
lib/usher/interface/rack_interface/route.rb,
lib/usher/interface/rails2_2_interface/mapper.rb

Defined Under Namespace

Classes: EmailInterface, MerbInterface, RackInterface, Rails2_2Interface, Rails2_3Interface, Rails3Interface, TextInterface

Class Method Summary collapse

Class Method Details

.class_for(type) ⇒ Object


15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/usher/interface.rb', line 15

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

.for(type, &blk) ⇒ Object


11
12
13
# File 'lib/usher/interface.rb', line 11

def self.for(type, &blk)
  class_for(type).new(&blk)
end