Class: Bicho::Query
- Inherits:
-
Object
- Object
- Bicho::Query
- Defined in:
- lib/bicho/query.rb
Overview
Represents a bug search to the server and it can be configured with all bug attributes.
Instance Attribute Summary (collapse)
-
- (Object) query_map
readonly
obtains the parameter that can be passed to the XMLRPC API.
Instance Method Summary (collapse)
-
- (Object) each {|Bicho::Bug| ... }
Iterates through the result of the current query.
-
- (Query) initialize(conditions = {})
constructor
Create a query.
-
- (Object) L3
Shortcut, equivalent to.
-
- (Object) method_missing(name, *args)
Query responds to all the bug search attributes.
-
- (Object) open
Shortcut equivalent to status new, assigned, needinfo and reopened.
Constructor Details
- (Query) initialize(conditions = {})
Create a query.
58 59 60 |
# File 'lib/bicho/query.rb', line 58 def initialize(conditions={}) @query_map = conditions end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
- (Object) method_missing(name, *args)
Query responds to all the bug search attributes.
65 66 67 68 69 70 |
# File 'lib/bicho/query.rb', line 65 def method_missing(name, *args) args.each do |arg| append_query(name.to_s, arg) end self end |
Instance Attribute Details
- (Object) query_map (readonly)
obtains the parameter that can be passed to the XMLRPC API
48 49 50 |
# File 'lib/bicho/query.rb', line 48 def query_map @query_map end |
Instance Method Details
- (Object) each {|Bicho::Bug| ... }
Note:
Requires Bicho.client to be set
Iterates through the result of the current query.
40 41 42 43 44 |
# File 'lib/bicho/query.rb', line 40 def each ret = Bicho.client.search_bugs(self) return ret.each if not block_given? ret.each { |bug| yield bug } end |
- (Object) L3
Shortcut, equivalent to
:summary => "L3"
79 80 81 82 |
# File 'lib/bicho/query.rb', line 79 def L3 append_query("summary", "L3") self end |
- (Object) open
Shortcut equivalent to status new, assigned, needinfo and reopened
73 74 75 |
# File 'lib/bicho/query.rb', line 73 def open status(:new).status(:assigned).status(:needinfo).status(:reopened) end |