Forum: Ruby embedding a library into a method ...

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
0075c9c01267b117ac97b7a02f97dbd4?d=identicon&s=25 Mathspeedy (Guest)
on 2009-05-13 01:41
(Received via mailing list)
Hi all,
I wanted to embed the Net::Telnet into a method, just look my code ...

#CODE start here
#!/usr/bin/ruby

require "net/telnet"

class VictimInfo
  attr_accessor :ip, :port
  #ask for Victim infos
  def initialize( )
    puts "Victim infos:."
    puts "Ip Address: "
    puts "Ip Address: #{@ip = gets.to_s}"
    puts "Remote Port: "
    puts "Remote Port: #{@port = gets.to_i}"
  end
  #connect to the Victim computer
  def connect( ) # I want to use the Net::Telnet library in this
method
#CODE finish here

someone know the way to do it; I know complex method but if there's a
simple way to do it ...
0075c9c01267b117ac97b7a02f97dbd4?d=identicon&s=25 Mathspeedy (Guest)
on 2009-05-13 02:15
(Received via mailing list)
Could someone ANSWER my QUESTION please ...
47b1910084592eb77a032bc7d8d1a84e?d=identicon&s=25 Joel VanderWerf (Guest)
on 2009-05-13 02:40
(Received via mailing list)
Mathspeedy wrote:
> Hi all,
> I wanted to embed the Net::Telnet into a method, just look my code ...

Try copying some of the code from here...

http://www.ruby-doc.org/stdlib/libdoc/net/telnet/r...
0075c9c01267b117ac97b7a02f97dbd4?d=identicon&s=25 Mathspeedy (Guest)
on 2009-05-13 03:31
(Received via mailing list)
On 12 mai, 20:37, Joel VanderWerf <vj...@path.berkeley.edu> wrote:
> Mathspeedy wrote:
> > Hi all,
> > I wanted to embed the Net::Telnet into a method, just look my code ...
>
> Try copying some of the code from here...
>
> http://www.ruby-doc.org/stdlib/libdoc/net/telnet/r......
>
> --
>        vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407

I think I have an idea ...
This topic is locked and can not be replied to.