Class: WavefrontCli::Subcommand::Import
- Inherits:
-
Object
- Object
- WavefrontCli::Subcommand::Import
- Defined in:
- lib/wavefront-cli/subcommands/import.rb
Overview
Stuff to import an object
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#wf ⇒ Object
readonly
Returns the value of attribute wf.
Instance Method Summary collapse
-
#initialize(calling_class, options) ⇒ Import
constructor
A new instance of Import.
- #run! ⇒ Object
Constructor Details
#initialize(calling_class, options) ⇒ Import
Returns a new instance of Import.
13 14 15 16 17 18 |
# File 'lib/wavefront-cli/subcommands/import.rb', line 13 def initialize(calling_class, ) @calling_class = calling_class @wf = calling_class.wf @options = @message = 'IMPORTED' end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
11 12 13 |
# File 'lib/wavefront-cli/subcommands/import.rb', line 11 def @options end |
#wf ⇒ Object (readonly)
Returns the value of attribute wf.
11 12 13 |
# File 'lib/wavefront-cli/subcommands/import.rb', line 11 def wf @wf end |
Instance Method Details
#run! ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/wavefront-cli/subcommands/import.rb', line 20 def run! errs = 0 [raw_input].flatten.each do |obj| resp = import_object(obj) next if [:noop] errs += 1 unless resp.ok? puts (obj, resp) end exit errs end |