Class: APRIL::Client
- Inherits:
-
Object
- Object
- APRIL::Client
- Defined in:
- lib/april/client.rb
Instance Attribute Summary collapse
-
#channels ⇒ Object
readonly
Returns the value of attribute channels.
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#irc ⇒ Object
readonly
Returns the value of attribute irc.
-
#modules ⇒ Object
readonly
Returns the value of attribute modules.
-
#nick ⇒ Object
readonly
Returns the value of attribute nick.
-
#realname ⇒ Object
readonly
Returns the value of attribute realname.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
- #go ⇒ Object
-
#initialize(config) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(config) ⇒ Client
Returns a new instance of Client.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/april/client.rb', line 7 def initialize(config) @version = APRIL::VERSION @modules = {} @irc = APRIL::Socket.new @config = config @config.each do |k,v| self.class.send(:define_method, k, proc{v}) end @nick = informations[0]["nick"] @user = informations[1]["user"] @realname = informations[2]["realname"] @channels = channels end |
Instance Attribute Details
#channels ⇒ Object (readonly)
Returns the value of attribute channels.
4 5 6 |
# File 'lib/april/client.rb', line 4 def channels @channels end |
#config ⇒ Object (readonly)
Returns the value of attribute config.
4 5 6 |
# File 'lib/april/client.rb', line 4 def config @config end |
#irc ⇒ Object (readonly)
Returns the value of attribute irc.
4 5 6 |
# File 'lib/april/client.rb', line 4 def irc @irc end |
#modules ⇒ Object (readonly)
Returns the value of attribute modules.
4 5 6 |
# File 'lib/april/client.rb', line 4 def modules @modules end |
#nick ⇒ Object (readonly)
Returns the value of attribute nick.
4 5 6 |
# File 'lib/april/client.rb', line 4 def nick @nick end |
#realname ⇒ Object (readonly)
Returns the value of attribute realname.
4 5 6 |
# File 'lib/april/client.rb', line 4 def realname @realname end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
4 5 6 |
# File 'lib/april/client.rb', line 4 def user @user end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
4 5 6 |
# File 'lib/april/client.rb', line 4 def version @version end |
Instance Method Details
#go ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/april/client.rb', line 25 def go @irc.connect(server, port) @irc.user(@user, @realname) @irc.nick(@nick) @irc.join(@channels) @irc.listen end |