Class: DnsMadeEasy::Runner
- Inherits:
-
Object
- Object
- DnsMadeEasy::Runner
- Defined in:
- lib/dnsmadeeasy/runner.rb
Constant Summary collapse
- SUPPORTED_FORMATS =
%w(json json_pretty yaml pp)
Instance Attribute Summary collapse
-
#argv ⇒ Object
Returns the value of attribute argv.
-
#format ⇒ Object
Returns the value of attribute format.
-
#operation ⇒ Object
Returns the value of attribute operation.
Instance Method Summary collapse
- #execute! ⇒ Object
-
#initialize(argv = nil) ⇒ Runner
constructor
A new instance of Runner.
Constructor Details
#initialize(argv = nil) ⇒ Runner
Returns a new instance of Runner.
15 16 17 18 |
# File 'lib/dnsmadeeasy/runner.rb', line 15 def initialize(argv = nil) self.argv = argv || ARGV.dup self.format = process_flags_format end |
Instance Attribute Details
#argv ⇒ Object
Returns the value of attribute argv.
13 14 15 |
# File 'lib/dnsmadeeasy/runner.rb', line 13 def argv @argv end |
#format ⇒ Object
Returns the value of attribute format.
13 14 15 |
# File 'lib/dnsmadeeasy/runner.rb', line 13 def format @format end |
#operation ⇒ Object
Returns the value of attribute operation.
13 14 15 |
# File 'lib/dnsmadeeasy/runner.rb', line 13 def operation @operation end |
Instance Method Details
#execute! ⇒ Object
20 21 22 23 24 25 26 27 28 |
# File 'lib/dnsmadeeasy/runner.rb', line 20 def execute! if argv.empty? || argv.size < 1 else configure_authentication self.operation = argv.shift.to_sym exit call_through_client(operation) end end |