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.5"
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.
-
#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.
62 63 64 65 66 67 68 69 70 71 |
# File 'lib/zircon.rb', line 62 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 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.
9 10 11 |
# File 'lib/zircon.rb', line 9 def channel @channel end |
#nickname ⇒ Object
Returns the value of attribute nickname.
9 10 11 |
# File 'lib/zircon.rb', line 9 def nickname @nickname end |
#port ⇒ Object
Returns the value of attribute port.
9 10 11 |
# File 'lib/zircon.rb', line 9 def port @port end |
#realname ⇒ Object
Returns the value of attribute realname.
9 10 11 |
# File 'lib/zircon.rb', line 9 def realname @realname end |
#server ⇒ Object
Returns the value of attribute server.
9 10 11 |
# File 'lib/zircon.rb', line 9 def server @server end |
#username ⇒ Object
Returns the value of attribute username.
9 10 11 |
# File 'lib/zircon.rb', line 9 def username @username end |
Instance Method Details
#login ⇒ Object
84 85 86 87 88 89 |
# File 'lib/zircon.rb', line 84 def login pass @password if @password nick @nickname user @username, 0, "*", ":" + @realname join @channel if @channel end |
#run! ⇒ Object
73 74 75 76 |
# File 'lib/zircon.rb', line 73 def run! login end |