Class: TPB::Ext
Instance Attribute Summary collapse
-
#results ⇒ Object
Returns the value of attribute results.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app = nil, opts = {}, params = {}) ⇒ Ext
constructor
A new instance of Ext.
Methods included from Internal
Constructor Details
#initialize(app = nil, opts = {}, params = {}) ⇒ Ext
12 13 14 15 16 |
# File 'lib/mushin_ext_tpb.rb', line 12 def initialize app=nil, opts={}, params={} @app = app @opts = opts @params = params end |
Instance Attribute Details
#results ⇒ Object
Returns the value of attribute results.
10 11 12 |
# File 'lib/mushin_ext_tpb.rb', line 10 def results @results end |
Instance Method Details
#call(env) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/mushin_ext_tpb.rb', line 17 def call env env ||= Hash.new $log.debug "#{self} ------ Inbound maniuplation" env[:query] = @params[:query] env[:id] = @params[:query] case when env[:query].nil?, env[:query].empty? p "empty query is no good" else results = search(env[:query]) env[:tpb] = results end @app.call(env) $log.debug "#{self} ------ Outbound maniuplation" end |