Class: Rundeck::Execution::QueryBuilder
- Inherits:
-
Object
- Object
- Rundeck::Execution::QueryBuilder
- Defined in:
- lib/rundeck-ruby-client/execution.rb
Instance Attribute Summary collapse
-
#max ⇒ Object
Returns the value of attribute max.
-
#offset ⇒ Object
Returns the value of attribute offset.
-
#status ⇒ Object
Returns the value of attribute status.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#max ⇒ Object
Returns the value of attribute max.
75 76 77 |
# File 'lib/rundeck-ruby-client/execution.rb', line 75 def max @max end |
#offset ⇒ Object
Returns the value of attribute offset.
75 76 77 |
# File 'lib/rundeck-ruby-client/execution.rb', line 75 def offset @offset end |
#status ⇒ Object
Returns the value of attribute status.
75 76 77 |
# File 'lib/rundeck-ruby-client/execution.rb', line 75 def status @status end |
Class Method Details
.valid_statuses ⇒ Object
77 78 79 |
# File 'lib/rundeck-ruby-client/execution.rb', line 77 def self.valid_statuses %w(succeeded failed aborted running) << nil end |
Instance Method Details
#query ⇒ Object
87 88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/rundeck-ruby-client/execution.rb', line 87 def query validate [ "", status && "statusFilter=#{status}", max && "max=#{max.to_i}", offset && "offset=#{offset.to_i}", ].compact .join("&") .chomp("&") end |
#validate ⇒ Object
81 82 83 84 85 |
# File 'lib/rundeck-ruby-client/execution.rb', line 81 def validate raise "Invalid requested status: #{status}" unless status.nil? || elf.class.valid_statuses.include?(status.to_s) raise "Invalid offset: #{offset}" unless offset.nil? || offset.to_i >= 0 raise "Invalid max: #{max}" unless max.nil? || max.to_i >= 0 end |