Class: ReverseTunnel::CLI::Base
- Inherits:
-
Object
- Object
- ReverseTunnel::CLI::Base
- Defined in:
- lib/reverse-tunnel/cli.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#arguments ⇒ Object
readonly
Returns the value of attribute arguments.
Instance Method Summary collapse
- #configure(object = self) ⇒ Object
-
#initialize(arguments = []) ⇒ Base
constructor
A new instance of Base.
- #options ⇒ Object
Constructor Details
#initialize(arguments = []) ⇒ Base
Returns a new instance of Base.
18 19 20 |
# File 'lib/reverse-tunnel/cli.rb', line 18 def initialize(arguments = []) @arguments = arguments end |
Instance Attribute Details
#arguments ⇒ Object (readonly)
Returns the value of attribute arguments.
16 17 18 |
# File 'lib/reverse-tunnel/cli.rb', line 16 def arguments @arguments end |
Instance Method Details
#configure(object = self) ⇒ Object
28 29 30 31 32 33 34 35 36 |
# File 'lib/reverse-tunnel/cli.rb', line 28 def configure(object = self) .each do |k,v| unless [:help, :version].include? k or k.to_s =~ /_given$/ object.send "#{k.to_s.gsub('-','_')}=", v end end object end |
#options ⇒ Object
22 23 24 25 26 |
# File 'lib/reverse-tunnel/cli.rb', line 22 def @options ||= Trollop::with_standard_exception_handling(parser) do parser.parse arguments end end |