Class: Zircon
- Inherits:
-
Object
- Object
- Zircon
- Includes:
- Callback
- Defined in:
- lib/zircon.rb,
lib/zircon/message.rb,
lib/zircon/version.rb,
lib/zircon/callback.rb,
lib/zircon/message/patterns.rb
Defined Under Namespace
Modules: Callback Classes: Message
Constant Summary collapse
- COMMAND_NAMES =
%w[ ADMIN AWAY CREDITS CYCLE DALINFO INVITE ISON JOIN KICK KNOCK LICENSE LINKS LIST LUSERS MAP MODE MOTD NAMES NICK NOTICE PART PASS PING PONG PRIVMSG QUIT RULES SETNAME SILENCE STATS TIME TOPIC USER USERHOST VERSION VHOST WATCH WHO WHOIS WHOWAS NUMERICREPLY ].freeze
- VERSION =
"0.0.8"
Instance Attribute Summary collapse
-
#channel ⇒ Object
Returns the value of attribute channel.
-
#nickname ⇒ Object
Returns the value of attribute nickname.
-
#port ⇒ Object
Returns the value of attribute port.
-
#realname ⇒ Object
Returns the value of attribute realname.
-
#server ⇒ Object
Returns the value of attribute server.
-
#use_ssl ⇒ Object
Returns the value of attribute use_ssl.
-
#username ⇒ Object
Returns the value of attribute username.
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ Zircon
constructor
A new instance of Zircon.
- #login ⇒ Object
- #run! ⇒ Object
-
#wait_message ⇒ Object
Start blocking-loop.
Constructor Details
#initialize(args = {}) ⇒ Zircon
Returns a new instance of Zircon.
64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/zircon.rb', line 64 def initialize(args = {}) @server = args[:server] @port = args[:port] @channel = args[:channel] @password = args[:password] @username = args[:username] @nickname = args[:nickname] || @username @realname = args[:realname] || @username @use_ssl = args[:use_ssl] || false on_ping { || pong(.raw) } end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Zircon::Callback
Instance Attribute Details
#channel ⇒ Object
Returns the value of attribute channel.
10 11 12 |
# File 'lib/zircon.rb', line 10 def channel @channel end |
#nickname ⇒ Object
Returns the value of attribute nickname.
10 11 12 |
# File 'lib/zircon.rb', line 10 def nickname @nickname end |
#port ⇒ Object
Returns the value of attribute port.
10 11 12 |
# File 'lib/zircon.rb', line 10 def port @port end |
#realname ⇒ Object
Returns the value of attribute realname.
10 11 12 |
# File 'lib/zircon.rb', line 10 def realname @realname end |
#server ⇒ Object
Returns the value of attribute server.
10 11 12 |
# File 'lib/zircon.rb', line 10 def server @server end |
#use_ssl ⇒ Object
Returns the value of attribute use_ssl.
10 11 12 |
# File 'lib/zircon.rb', line 10 def use_ssl @use_ssl end |
#username ⇒ Object
Returns the value of attribute username.
10 11 12 |
# File 'lib/zircon.rb', line 10 def username @username end |
Instance Method Details
#login ⇒ Object
87 88 89 90 91 92 |
# File 'lib/zircon.rb', line 87 def login pass @password if @password nick @nickname user @username, 0, "*", ":" + @realname join @channel if @channel end |
#run! ⇒ Object
76 77 78 79 |
# File 'lib/zircon.rb', line 76 def run! login end |