Module: Buby::Implants::RequestInfo
- Defined in:
- lib/buby/implants/request_info.rb
Overview
This interface is used to retrieve key details about an HTTP request. Extensions can obtain an IRequestInfo
object for a given request by calling ExtensionHelpers#analyzeRequest.
Class Method Summary collapse
-
.implant(info) ⇒ Object
Install ourselves into the current
IRequestInfo
java class.
Instance Method Summary collapse
-
#getParameters ⇒ Array<IParameter>
This method is used to obtain the parameters contained in the request.
- #uri ⇒ Object
Class Method Details
.implant(info) ⇒ Object
Install ourselves into the current IRequestInfo
java class
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/buby/implants/request_info.rb', line 26 def self.implant(info) unless info.implanted? || info.nil? pp [:implanting, info, info.class] if $DEBUG info.class.class_exec(info) do |info| a_methods = %w{ getParameters } a_methods.each do |meth| alias_method "__"+meth.to_s, meth end include Buby::Implants::RequestInfo a_methods.each do |meth| java_class.ruby_names_for_java_method(meth).each do |ruby_meth| define_method ruby_meth, Buby::Implants::RequestInfo.instance_method(meth) end end include Buby::Implants::Proxy end end info end |
Instance Method Details
#getParameters ⇒ Array<IParameter>
This method is used to obtain the parameters contained in the request.
15 16 17 |
# File 'lib/buby/implants/request_info.rb', line 15 def getParameters __getParameters.tap{|parm| Buby::Implants::Parameter.implant parm.first} end |
#uri ⇒ Object
19 20 21 |
# File 'lib/buby/implants/request_info.rb', line 19 def uri URI.parse self.url.to_s end |