Sha256: 5189e7ced82f4b6a34c752a934af14bc0a09ed98f82acae2eb5b18ec97dc172d

Contents?: true

Size: 388 Bytes

Versions: 5

Compression:

Stored size: 388 Bytes

Contents

class Snmpjr
  class Response
    attr_reader :error

    def initialize response = {}
      @error = response[:error] || ''
      @value = response[:value] || ''
    end

    def error?
      if @error.empty?
        false
      else
        true
      end
    end

    def to_s
      @value
    end

    def ==(other)
      @error == other.error && to_s == other.to_s
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
snmpjr-0.2.1-java lib/snmpjr/response.rb
snmpjr-0.2.0-java lib/snmpjr/response.rb
snmpjr-0.1.7-java lib/snmpjr/response.rb
snmpjr-0.1.5-java lib/snmpjr/response.rb
snmpjr-0.1.4-java lib/snmpjr/response.rb