Class: Zircon

Inherits:
Object
  • Object
show all
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
].freeze
VERSION =
"0.0.3"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ Zircon

Returns a new instance of Zircon.



61
62
63
64
65
66
67
68
69
70
# File 'lib/zircon.rb', line 61

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 { |message| pong(message.text) }
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Zircon::Callback

Instance Attribute Details

#channelObject

Returns the value of attribute channel.



9
10
11
# File 'lib/zircon.rb', line 9

def channel
  @channel
end

#nicknameObject

Returns the value of attribute nickname.



9
10
11
# File 'lib/zircon.rb', line 9

def nickname
  @nickname
end

#portObject

Returns the value of attribute port.



9
10
11
# File 'lib/zircon.rb', line 9

def port
  @port
end

#realnameObject

Returns the value of attribute realname.



9
10
11
# File 'lib/zircon.rb', line 9

def realname
  @realname
end

#serverObject

Returns the value of attribute server.



9
10
11
# File 'lib/zircon.rb', line 9

def server
  @server
end

#usernameObject

Returns the value of attribute username.



9
10
11
# File 'lib/zircon.rb', line 9

def username
  @username
end

Instance Method Details

#run!Object



72
73
74
75
# File 'lib/zircon.rb', line 72

def run!
  
  wait_message
end