Class: Cure::Dsl::Queries
- Inherits:
-
Object
- Object
- Cure::Dsl::Queries
- Defined in:
- lib/cure/dsl/queries.rb
Defined Under Namespace
Classes: Query
Instance Attribute Summary collapse
-
#candidates ⇒ Object
readonly
Returns the value of attribute candidates.
Instance Method Summary collapse
- #find(named_range) ⇒ Object
-
#initialize ⇒ Queries
constructor
A new instance of Queries.
- #with(query:, named_range: "_default") ⇒ Object
Constructor Details
#initialize ⇒ Queries
Returns a new instance of Queries.
12 13 14 |
# File 'lib/cure/dsl/queries.rb', line 12 def initialize @candidates = [] end |
Instance Attribute Details
#candidates ⇒ Object (readonly)
Returns the value of attribute candidates.
10 11 12 |
# File 'lib/cure/dsl/queries.rb', line 10 def candidates @candidates end |
Instance Method Details
#find(named_range) ⇒ Object
21 22 23 |
# File 'lib/cure/dsl/queries.rb', line 21 def find(named_range) @candidates.find { |candidate| candidate.named_range.to_sym == named_range.to_sym } end |