Class: Rundeck::Execution::SearchQueryBuilder
- Inherits:
-
Object
- Object
- Rundeck::Execution::SearchQueryBuilder
- Defined in:
- lib/rundeck-ruby/execution.rb
Defined Under Namespace
Classes: ValidationError
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.
85 86 87 |
# File 'lib/rundeck-ruby/execution.rb', line 85 def max @max end |
#offset ⇒ Object
Returns the value of attribute offset.
85 86 87 |
# File 'lib/rundeck-ruby/execution.rb', line 85 def offset @offset end |
#status ⇒ Object
Returns the value of attribute status.
85 86 87 |
# File 'lib/rundeck-ruby/execution.rb', line 85 def status @status end |
Class Method Details
.valid_statuses ⇒ Object
95 96 97 |
# File 'lib/rundeck-ruby/execution.rb', line 95 def self.valid_statuses %w(succeeded failed aborted running) << nil end |
Instance Method Details
#query ⇒ Object
105 106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/rundeck-ruby/execution.rb', line 105 def query validate [ "", status && "statusFilter=#{status}", max && "max=#{max.to_i}", offset && "offset=#{offset.to_i}", ].compact .join("&") .chomp("&") end |
#validate ⇒ Object
99 100 101 102 103 |
# File 'lib/rundeck-ruby/execution.rb', line 99 def validate raise ValidationError.new("requested status", status) unless status.nil? || self.class.valid_statuses.include?(status.to_s) raise ValidationError.new("offset", offset) unless offset.nil? || offset.to_i >= 0 raise ValidationError.new("max", max) unless max.nil? || max.to_i >= 0 end |