Sha256: 3132c869fd3d754ba6f65581df488f123747f65e3d47c6beb925235db63d3638

Contents?: true

Size: 917 Bytes

Versions: 7

Compression:

Stored size: 917 Bytes

Contents

require 'uri'

class Buby
  class ScanIssuesList < BubyArrayWrapper
    def initialize(obj)
      ScanIssueHelper.implant(obj[0]) if obj.size > 0 
      super(obj)
    end
  end

  # @deprecated this will change to the new style in the next release
  module ScanIssueHelper
    # Returns a Ruby URI object derived from the java.net.URL object
    def uri
      @uri ||= URI.parse url.to_s if not url.nil?
    end

    # one-shot method to implant ourselves onto a target object's class
    # interface in ruby. All later instances will also get 'us' for free!
    def self.implant(base)
      return if @implanted
      base.class.instance_eval { include(ScanIssueHelper) }
      @implanted = true
    end

    def http_messages
      HttpRequestResponseList.new( self.getHttpMessages() )
    end
    alias messages http_messages
    alias messages http_messages

    def self.implanted? ; @implanted; end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
buby-1.5.2-java lib/buby/implants/scan_issue.rb
buby-1.5.1-java lib/buby/implants/scan_issue.rb
buby-1.5.0-java lib/buby/implants/scan_issue.rb
buby-1.5.0.pre4-java lib/buby/implants/scan_issue.rb
buby-1.5.0.pre3-java lib/buby/implants/scan_issue.rb
buby-1.5.0.pre2-java lib/buby/implants/scan_issue.rb
buby-1.5.0.pre1-java lib/buby/implants/scan_issue.rb