Class: SNMP::OctetString

Inherits:
String
  • Object
show all
Defined in:
lib/snmp/varbind.rb

Direct Known Subclasses

Opaque

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.decode(value_data) ⇒ Object


131
132
133
# File 'lib/snmp/varbind.rb', line 131

def self.decode(value_data)
  OctetString.new(value_data)
end

Instance Method Details

#asn1_typeObject


135
136
137
# File 'lib/snmp/varbind.rb', line 135

def asn1_type
  "OCTET STRING"
end

#encodeObject


139
140
141
# File 'lib/snmp/varbind.rb', line 139

def encode
  encode_octet_string(self)
end

#to_oidObject


143
144
145
146
147
# File 'lib/snmp/varbind.rb', line 143

def to_oid
  oid = ObjectId.new
  each_byte { |b| oid << b }
  oid
end