Class: Buby::Parameter::Base

Inherits:
Object
  • Object
show all
Includes:
Java::Burp::IParameter
Defined in:
lib/buby/parameter/base.rb

Direct Known Subclasses

Body, Cookie, Url

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeBase #initialize(hash) ⇒ Base #initialize(name, value) ⇒ Base #initialize(name, value, type) ⇒ Base

Returns a new instance of Base.

Overloads:

  • #initializeBase

    Create an empty instance

    Parameters:

    • (void)
  • #initialize(hash) ⇒ Base

    Parameters:

    • hash (Hash)

      name set to key, value set to value

  • #initialize(name, value) ⇒ Base

    Parameters:

    • name (String)
    • value (String)
  • #initialize(name, value, type) ⇒ Base

    Parameters:

    • name (String)
    • value (String)
    • type (Fixnum)

Raises:

  • (ArgumentError)


19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/buby/parameter/base.rb', line 19

def initialize *args
  raise ArgumentError, "#{args.size} for 0..3" if args.size > 3
  case args.size
  when 0
  when 1
    hsh = args.first
    @name = hsh[:name] || hsh['name']
    @value = hsh[:value] || hsh['value']
  when 2, 3
    @name, @value, @type = args
  end
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



5
6
7
# File 'lib/buby/parameter/base.rb', line 5

def name
  @name
end

#valueObject

Returns the value of attribute value.



5
6
7
# File 'lib/buby/parameter/base.rb', line 5

def value
  @value
end

Instance Method Details

#getNameObject



32
# File 'lib/buby/parameter/base.rb', line 32

def getName; @name;   end

#getNameEndObject



35
# File 'lib/buby/parameter/base.rb', line 35

def getNameEnd;   -1; end

#getNameStartObject



34
# File 'lib/buby/parameter/base.rb', line 34

def getNameStart; -1; end

#getTypeObject



31
# File 'lib/buby/parameter/base.rb', line 31

def getType; @type.to_i; end

#getValueObject



33
# File 'lib/buby/parameter/base.rb', line 33

def getValue; @value; end

#getValueEndObject



36
# File 'lib/buby/parameter/base.rb', line 36

def getValueEnd;  -1; end

#getValueStartObject



37
# File 'lib/buby/parameter/base.rb', line 37

def getValueStart;-1; end