Class: Medic::AnchoredObjectQueryBuilder

Inherits:
Object
  • Object
show all
Includes:
Anchor, Predicate, Types
Defined in:
lib/medic/anchored_object_query_builder.rb

Constant Summary

Constants included from Anchor

Medic::Anchor::NUMBER_WORDS

Constants included from QueryOptions

QueryOptions::QUERY_OPTIONS

Constants included from Types

Types::TYPE_IDENTIFIERS

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Anchor

#anchor_for_symbol

Methods included from Predicate

#predicate

Methods included from QueryOptions

#query_option, #query_options

Methods included from Types

#object_type, #type_identifier

Constructor Details

#initialize(args = {}, block = Proc.new) ⇒ AnchoredObjectQueryBuilder

Returns a new instance of AnchoredObjectQueryBuilder.



10
11
12
13
14
15
16
17
18
# File 'lib/medic/anchored_object_query_builder.rb', line 10

def initialize(args={}, block=Proc.new)
  @params = args
  @query = HKAnchoredObjectQuery.alloc.initWithType(object_type(args[:type]),
    predicate: predicate(args),
    anchor: anchor_for_symbol(args[:anchor_date] || args[:anchor] || args[:date] || HKAnchoredObjectQueryNoAnchor),
    limit: args[:limit] || HKObjectQueryNoLimit,
    completionHandler: block
  )
end

Instance Attribute Details

#paramsObject (readonly)

Returns the value of attribute params.



3
4
5
# File 'lib/medic/anchored_object_query_builder.rb', line 3

def params
  @params
end

#queryObject (readonly)

Returns the value of attribute query.



4
5
6
# File 'lib/medic/anchored_object_query_builder.rb', line 4

def query
  @query
end