Class: Medic::SampleQueryBuilder
- Inherits:
-
Object
- Object
- Medic::SampleQueryBuilder
- Defined in:
- lib/medic/sample_query_builder.rb
Constant Summary
Constants included from Sort
Constants included from QueryOptions
Constants included from Types
Instance Attribute Summary collapse
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#query ⇒ Object
readonly
Returns the value of attribute query.
Instance Method Summary collapse
-
#initialize(args = {}, block = Proc.new) ⇒ SampleQueryBuilder
constructor
A new instance of SampleQueryBuilder.
Methods included from Sort
#sort_descriptors, #sort_identifier
Methods included from Predicate
Methods included from QueryOptions
Methods included from Types
#object_type, #type_identifier
Constructor Details
#initialize(args = {}, block = Proc.new) ⇒ SampleQueryBuilder
Returns a new instance of SampleQueryBuilder.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/medic/sample_query_builder.rb', line 10 def initialize(args={}, block=Proc.new) @params = args sort = args[:sort_descriptors] || args[:sort_by] || args[:sort_asc] || args[:sort] sort = sort_descriptors(sort) if sort sort ||= sort_descriptors(args[:sort_desc], false) if args[:sort_desc] @query = HKSampleQuery.alloc.initWithSampleType(object_type(args[:type]), predicate: predicate(args), limit: args[:limit] || HKObjectQueryNoLimit, sortDescriptors: sort, resultsHandler: block ) end |
Instance Attribute Details
#params ⇒ Object (readonly)
Returns the value of attribute params.
3 4 5 |
# File 'lib/medic/sample_query_builder.rb', line 3 def params @params end |
#query ⇒ Object (readonly)
Returns the value of attribute query.
4 5 6 |
# File 'lib/medic/sample_query_builder.rb', line 4 def query @query end |