Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/net/ber.rb,
lib/net/ber.rb

Instance Method Summary collapse

Instance Method Details

#read_ber(syntax = nil) ⇒ Object



144
145
146
# File 'lib/net/ber.rb', line 144

def read_ber syntax=nil
  StringIO.new(self).read_ber(syntax)
end

#to_ber(code = 4) ⇒ Object

to_ber A universal octet-string is tag number 4, but others are possible depending on the context, so we let the caller give us one. The preferred way to do this in user code is via to_ber_application_sring and to_ber_contextspecific.



228
229
230
# File 'lib/net/ber.rb', line 228

def to_ber code = 4
  [code].pack('C') + length.to_ber_length_encoding + self
end

#to_ber_application_string(code) ⇒ Object

to_ber_application_string



235
236
237
# File 'lib/net/ber.rb', line 235

def to_ber_application_string code
  to_ber( 0x40 + code )
end

#to_ber_contextspecific(code) ⇒ Object

to_ber_contextspecific



242
243
244
# File 'lib/net/ber.rb', line 242

def to_ber_contextspecific code
  to_ber( 0x80 + code )
end