Module: Buby::Implants::Parameter

Defined in:
lib/buby/implants/parameter.rb

Overview

This interface is used to hold details about an HTTP request parameter.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.implant(parameter) ⇒ Object

Install ourselves into the current IParameter java class

Parameters:

  • parameter (IParameter)


58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/buby/implants/parameter.rb', line 58

def self.implant(parameter)
  unless parameter.implanted? || parameter.nil?
    pp [:implanting, parameter, parameter.class] if $DEBUG
    parameter.class.class_exec(parameter) do |parameter|
      a_methods = %w{
        getNameStart
        getNameEnd
        getValueEnd
        getValueStart
      }
      a_methods.each do |meth|
        alias_method "__"+meth.to_s, meth
      end
      include Buby::Implants::Parameter
      a_methods.each do |meth|
        java_class.ruby_names_for_java_method(meth).each do |ruby_meth|
          define_method ruby_meth, Buby::Implants::Parameter.instance_method(meth)
        end
      end
      include Buby::Implants::Proxy
    end
  end
  parameter
end

Instance Method Details

#getNameEndFixnum?

This method is used to retrieve the end offset of the parameter name within the HTTP request.

Returns:

  • (Fixnum, nil)

    The end offset of the parameter name within the HTTP request, or nil if the parameter is not associated with a specific request.



26
27
28
29
# File 'lib/buby/implants/parameter.rb', line 26

def getNameEnd
  ret = __getNameEnd
  ret == -1 ? nil : ret
end

#getNameStartFixnum?

This method is used to retrieve the start offset of the parameter name within the HTTP request.

Returns:

  • (Fixnum, nil)

    The start offset of the parameter name within the HTTP request, or nil if the parameter is not associated with a specific request.



14
15
16
17
# File 'lib/buby/implants/parameter.rb', line 14

def getNameStart
  ret = __getNameStart
  ret == -1 ? nil : ret
end

#getValueEndFixnum?

This method is used to retrieve the end offset of the parameter value within the HTTP request.

Returns:

  • (Fixnum, nil)

    The end offset of the parameter value within the HTTP request, or nil if the parameter is not associated with a specific request.



50
51
52
53
# File 'lib/buby/implants/parameter.rb', line 50

def getValueEnd
  ret = __getValueEnd
  ret == -1 ? nil : ret
end

#getValueStartFixnum?

This method is used to retrieve the start offset of the parameter value within the HTTP request.

Returns:

  • (Fixnum, nil)

    The start offset of the parameter value within the HTTP request, or nil if the parameter is not associated with a specific request.



38
39
40
41
# File 'lib/buby/implants/parameter.rb', line 38

def getValueStart
  ret = __getValueStart
  ret == -1 ? nil : ret
end