Class: Rundeck::Job::JobExecutionQueryBuilder
- Inherits:
-
Object
- Object
- Rundeck::Job::JobExecutionQueryBuilder
- Defined in:
- lib/rundeck-ruby-client/job.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.
46 47 48 |
# File 'lib/rundeck-ruby-client/job.rb', line 46 def max @max end |
#offset ⇒ Object
Returns the value of attribute offset.
46 47 48 |
# File 'lib/rundeck-ruby-client/job.rb', line 46 def offset @offset end |
#status ⇒ Object
Returns the value of attribute status.
46 47 48 |
# File 'lib/rundeck-ruby-client/job.rb', line 46 def status @status end |
Class Method Details
.valid_statuses ⇒ Object
48 49 50 |
# File 'lib/rundeck-ruby-client/job.rb', line 48 def self.valid_statuses Execution::QueryBuilder.valid_statuses end |
Instance Method Details
#query ⇒ Object
58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/rundeck-ruby-client/job.rb', line 58 def query validate clauses = [ status && "status=#{status}", max && "max=#{max.to_i}", offset && "offset=#{offset.to_i}", ].compact.join('&') "?#{clauses}".chomp('?') end |
#validate ⇒ Object
52 53 54 55 56 |
# File 'lib/rundeck-ruby-client/job.rb', line 52 def validate raise "Invalid requested status: #{status}" unless status.nil? || self.class.valid_statuses.include?(status.to_s) raise "Invalid offset" unless offset.nil? || offset.to_i >= 0 raise "Invalid max" unless max.nil? || max.to_i >= 0 end |