Class: RelayHelper::Options
- Inherits:
-
Object
- Object
- RelayHelper::Options
- Defined in:
- lib/weechat-relay-helper/options.rb
Instance Attribute Summary collapse
-
#compression ⇒ Object
readonly
Returns the value of attribute compression.
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#password ⇒ Object
readonly
Returns the value of attribute password.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
-
#ssl ⇒ Object
readonly
Returns the value of attribute ssl.
Instance Method Summary collapse
-
#initialize(args) ⇒ Options
constructor
A new instance of Options.
Constructor Details
#initialize(args) ⇒ Options
Returns a new instance of Options.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/weechat-relay-helper/options.rb', line 5 def initialize args OptionParser.new do |opts| opts. = "Usage: weelayhelper [options]" opts.on('-H', '--host hostname', String, 'Hostname of the Weechat instance') do |hn| @host = hn end opts.on('-P', '--password pass', String, 'Password (if needed) of the Weechat relay instance') do |pass| @password = pass end opts.on('-p', '--port port', Integer, 'Port that the Weechat instance is listening on') do |port| @port = port end opts.on('-s', '--[no-]ssl', 'Use SSL when connecting') do |ssl| @ssl = ssl end opts.on('-c', '--[no-]compression', 'Use Zlib to compress communication') do |compression| @compression = compression end opts.on_tail('-h', '--help', 'Shows this help message') do puts opts exit end end.parse! args end |
Instance Attribute Details
#compression ⇒ Object (readonly)
Returns the value of attribute compression.
4 5 6 |
# File 'lib/weechat-relay-helper/options.rb', line 4 def compression @compression end |
#host ⇒ Object (readonly)
Returns the value of attribute host.
4 5 6 |
# File 'lib/weechat-relay-helper/options.rb', line 4 def host @host end |
#password ⇒ Object (readonly)
Returns the value of attribute password.
4 5 6 |
# File 'lib/weechat-relay-helper/options.rb', line 4 def password @password end |
#port ⇒ Object (readonly)
Returns the value of attribute port.
4 5 6 |
# File 'lib/weechat-relay-helper/options.rb', line 4 def port @port end |
#ssl ⇒ Object (readonly)
Returns the value of attribute ssl.
4 5 6 |
# File 'lib/weechat-relay-helper/options.rb', line 4 def ssl @ssl end |