Class: RubySL::Socket::Foreign::Hostent
- Inherits:
-
Rubinius::FFI::Struct
- Object
- Rubinius::FFI::Struct
- RubySL::Socket::Foreign::Hostent
- Defined in:
- lib/rubysl/socket/foreign/hostent.rb
Instance Method Summary collapse
Instance Method Details
#addresses ⇒ Object
23 24 25 26 27 28 |
# File 'lib/rubysl/socket/foreign/hostent.rb', line 23 def addresses return [] unless self[:h_addr_list] RubySL::Socket::Foreign.pointers_of_type(self[:h_addr_list], :string) .map { |pointer| pointer.read_string(self[:h_length]) } end |
#aliases ⇒ Object
16 17 18 19 20 21 |
# File 'lib/rubysl/socket/foreign/hostent.rb', line 16 def aliases return [] unless self[:h_aliases] RubySL::Socket::Foreign.pointers_of_type(self[:h_aliases], :string) .map(&:read_string) end |
#hostname ⇒ Object
8 9 10 |
# File 'lib/rubysl/socket/foreign/hostent.rb', line 8 def hostname self[:h_name] end |
#to_s ⇒ Object
30 31 32 |
# File 'lib/rubysl/socket/foreign/hostent.rb', line 30 def to_s pointer.read_string(size) end |
#type ⇒ Object
12 13 14 |
# File 'lib/rubysl/socket/foreign/hostent.rb', line 12 def type self[:h_addrtype] end |