Class: Sponge::IRC::Client::OptionsDSL
- Inherits:
-
Object
- Object
- Sponge::IRC::Client::OptionsDSL
- Defined in:
- lib/sponge/irc/client.rb
Overview
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #hostname(val) ⇒ Object
-
#initialize(server = nil, &blk) ⇒ OptionsDSL
constructor
A new instance of OptionsDSL.
- #nickname(val) ⇒ Object
- #port(val) ⇒ Object
- #realname(val) ⇒ Object
- #server(val) ⇒ Object
- #username(val) ⇒ Object
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
#options ⇒ Object (readonly)
Returns the value of attribute options.
131 132 133 |
# File 'lib/sponge/irc/client.rb', line 131 def @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 |