In Files

  • mrbgems/mruby-socket/mrblib/socket.rb

Socket::Option

Attributes

data[R]

def self.linger(family, level, optname, integer) end

family[R]

def self.linger(family, level, optname, integer) end

level[R]

def self.linger(family, level, optname, integer) end

optname[R]

def self.linger(family, level, optname, integer) end

Public Class Methods

bool(family, level, optname, bool) click to toggle source
 
               # File mrbgems/mruby-socket/mrblib/socket.rb, line 586
def self.bool(family, level, optname, bool)
  self.new(family, level, optname, [(bool ? 1 : 0)].pack('i'))
end
            
int(family, level, optname, integer) click to toggle source
 
               # File mrbgems/mruby-socket/mrblib/socket.rb, line 590
def self.int(family, level, optname, integer)
  self.new(family, level, optname, [integer].pack('i'))
end
            
new(family, level, optname, data) click to toggle source
 
               # File mrbgems/mruby-socket/mrblib/socket.rb, line 579
def initialize(family, level, optname, data)
  @family  = family
  @level   = level
  @optname = optname
  @data    = data
end
            

Public Instance Methods

bool() click to toggle source
 
               # File mrbgems/mruby-socket/mrblib/socket.rb, line 599
def bool
  @data.unpack('i')[0] != 0
end
            
inspect() click to toggle source
 
               # File mrbgems/mruby-socket/mrblib/socket.rb, line 603
def inspect
  "#<Socket::Option: family:#{@family} level:#{@level} optname:#{@optname} #{@data.inspect}>"
end
            
int() click to toggle source
 
               # File mrbgems/mruby-socket/mrblib/socket.rb, line 607
def int
  @data.unpack('i')[0]
end
            
linger() click to toggle source
 
               # File mrbgems/mruby-socket/mrblib/socket.rb, line 611
def linger
  raise NotImplementedError.new
end
            
unpack(template) click to toggle source
 
               # File mrbgems/mruby-socket/mrblib/socket.rb, line 615
def unpack(template)
  raise NotImplementedError.new
end