Class: INatGet::Data::DSL::Condition::Query

Inherits:
INatGet::Data::DSL::Condition show all
Defined in:
lib/inat-get/data/dsl/conditions/query.rb

Metadata collapse

Attributes inherited from INatGet::Data::DSL::Condition

#manager

Operators collapse

Constructor collapse

Methods inherited from INatGet::Data::DSL::Condition

#!, #&, #api_query, #sequel_query, #|

Methods included from INatGet::Data::DSL

#AND, #ANYTHING, #NOT, #NOTHING, #OR, #Q, #finish_time, #get_identification, #get_observation, #get_place, #get_project, #get_taxon, #get_user, #now, #select_identifications, #select_observations, #select_places, #select_projects, #select_taxa, #select_users, #start_time, #time_range, #today, #version, #version!, #version?, #version_alias

Instance Attribute Details

#helperINatGet::Data::Helper (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



20
21
22
# File 'lib/inat-get/data/dsl/conditions/query.rb', line 20

def helper
  @helper
end

#modelclass of Sequel::Model (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (class of Sequel::Model)


16
17
18
# File 'lib/inat-get/data/dsl/conditions/query.rb', line 16

def model
  @model
end

#queryHash (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Hash)


12
13
14
# File 'lib/inat-get/data/dsl/conditions/query.rb', line 12

def query
  @query
end

Class Method Details

.[](model, validate: true, **query) ⇒ Condition

Returns:



54
55
56
57
# File 'lib/inat-get/data/dsl/conditions/query.rb', line 54

def [] model, validate: true, **query
  return creator(model) if query.empty?
  new(model, validate: validate, **query).freeze
end

Instance Method Details

#==(other) ⇒ Boolean

Returns:

  • (Boolean)


35
36
37
38
39
# File 'lib/inat-get/data/dsl/conditions/query.rb', line 35

def == other
  return true if self.equal?(other)
  return false unless other.is_a?(Query)
  self.query == other.query && self.helper == other.helper
end