Class: EewJpNotify::CLI::Params
- Inherits:
-
Object
- Object
- EewJpNotify::CLI::Params
- Defined in:
- lib/eew_jp_notify/cli.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
-
#initialize(args) ⇒ Params
constructor
A new instance of Params.
Constructor Details
#initialize(args) ⇒ Params
Returns a new instance of Params.
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/eew_jp_notify/cli.rb', line 7 def initialize(args) opt = OptionParser.new opt.on('-u user') { |v| @user = v } opt.on('-p password') { |v| @password = v } opt.on('-h') { @help_mode = true } opt.parse! args @config = {} @config[:user] = @user if @user @config[:password] = @password if @password @config[:help_mode] = true if @help_mode end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
18 19 20 |
# File 'lib/eew_jp_notify/cli.rb', line 18 def config @config end |