Class: Usher::Interface::RackInterface::Builder
- Inherits:
-
Rack::Builder
- Object
- Rack::Builder
- Usher::Interface::RackInterface::Builder
- Defined in:
- lib/usher/interface/rack_interface.rb
Instance Method Summary collapse
- #delete(path, options = nil, &block) ⇒ Object
- #get(path, options = nil, &block) ⇒ Object
-
#initialize(&block) ⇒ Builder
constructor
A new instance of Builder.
- #map(path, options = nil, &block) ⇒ Object
- #post(path, options = nil, &block) ⇒ Object
- #put(path, options = nil, &block) ⇒ Object
Constructor Details
#initialize(&block) ⇒ Builder
Returns a new instance of Builder.
7 8 9 10 |
# File 'lib/usher/interface/rack_interface.rb', line 7 def initialize(&block) @usher = Usher::Interface::RackInterface.new super end |
Instance Method Details
#delete(path, options = nil, &block) ⇒ Object
29 30 31 |
# File 'lib/usher/interface/rack_interface.rb', line 29 def delete(path, = nil, &block) self.map(path, .merge!(:conditions => {:request_method => "DELETE"}), &block) end |
#get(path, options = nil, &block) ⇒ Object
17 18 19 |
# File 'lib/usher/interface/rack_interface.rb', line 17 def get(path, = nil, &block) self.map(path, .merge!(:conditions => {:request_method => "GET"}), &block) end |
#map(path, options = nil, &block) ⇒ Object
12 13 14 15 |
# File 'lib/usher/interface/rack_interface.rb', line 12 def map(path, = nil, &block) @usher.add(path, ).to(&block) @ins << @usher unless @ins.last == @usher end |
#post(path, options = nil, &block) ⇒ Object
21 22 23 |
# File 'lib/usher/interface/rack_interface.rb', line 21 def post(path, = nil, &block) self.map(path, .merge!(:conditions => {:request_method => "POST"}), &block) end |
#put(path, options = nil, &block) ⇒ Object
25 26 27 |
# File 'lib/usher/interface/rack_interface.rb', line 25 def put(path, = nil, &block) self.map(path, .merge!(:conditions => {:request_method => "PUT"}), &block) end |