Class: Sponge::IRC::Client::OptionsDSL

Inherits:
Object
  • Object
show all
Defined in:
lib/sponge/irc/client.rb

Overview

Author

Description

TODO

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(server = nil, &blk) ⇒ OptionsDSL

Returns a new instance of OptionsDSL.



133
134
135
136
137
# File 'lib/sponge/irc/client.rb', line 133

def initialize(server=nil, &blk)
  @options = {}
  server(server) if server         
  instance_eval(&blk) if block_given?
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



131
132
133
# File 'lib/sponge/irc/client.rb', line 131

def options
  @options
end

Instance Method Details

#hostname(val) ⇒ Object



155
156
157
# File 'lib/sponge/irc/client.rb', line 155

def hostname(val)
  @options[:hostname] = val
end

#nickname(val) ⇒ Object



147
148
149
# File 'lib/sponge/irc/client.rb', line 147

def nickname(val)
  @options[:nickname] = val
end

#port(val) ⇒ Object



143
144
145
# File 'lib/sponge/irc/client.rb', line 143

def port(val)
  @options[:port] = val
end

#realname(val) ⇒ Object



159
160
161
# File 'lib/sponge/irc/client.rb', line 159

def realname(val)
  @options[:realname] = val
end

#server(val) ⇒ Object



139
140
141
# File 'lib/sponge/irc/client.rb', line 139

def server(val)
  @options[:server] = val
end

#username(val) ⇒ Object



151
152
153
# File 'lib/sponge/irc/client.rb', line 151

def username(val)
  @options[:username] = val
end