Class: Hivonic::Commands::HiveQueryCommand
- Inherits:
-
Subcommand
- Object
- Subcommand
- Hivonic::Commands::HiveQueryCommand
- Defined in:
- lib/hivonic/commands.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#db ⇒ Object
readonly
Returns the value of attribute db.
-
#hive_opts ⇒ Object
readonly
Returns the value of attribute hive_opts.
Attributes inherited from Subcommand
#dry_run, #exitstatus, #regexp, #time_format, #time_group_index, #ttl
Instance Method Summary collapse
-
#initialize(opts, args) ⇒ HiveQueryCommand
constructor
A new instance of HiveQueryCommand.
- #query ⇒ Object
- #subcommand ⇒ Object
Methods inherited from Subcommand
#is_successful?, #output, run, #run, #successful?
Constructor Details
#initialize(opts, args) ⇒ HiveQueryCommand
Returns a new instance of HiveQueryCommand.
97 98 99 100 101 |
# File 'lib/hivonic/commands.rb', line 97 def initialize(opts, args) super @hive_opts = opts['hive-opts'] @db = args[0] end |
Instance Attribute Details
#db ⇒ Object (readonly)
Returns the value of attribute db.
95 96 97 |
# File 'lib/hivonic/commands.rb', line 95 def db @db end |
#hive_opts ⇒ Object (readonly)
Returns the value of attribute hive_opts.
94 95 96 |
# File 'lib/hivonic/commands.rb', line 94 def hive_opts @hive_opts end |
Instance Method Details
#query ⇒ Object
103 104 105 |
# File 'lib/hivonic/commands.rb', line 103 def query @query = nil end |
#subcommand ⇒ Object
107 108 109 |
# File 'lib/hivonic/commands.rb', line 107 def subcommand @subcommand = "hive #{self.hive_opts} -e \"#{self.query}\"" end |