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

Inherits:
Object
  • Object
show all
Includes:
INatGet::Data::DSL
Defined in:
lib/inat-get/data/dsl/conditions/base.rb

Direct Known Subclasses

AND, Anything, NOT, Nothing, OR, Query, Special::ProjectUsers

Defined Under Namespace

Modules: Special Classes: AND, Anything, NOT, Nothing, OR, Query

Metadata collapse

Operators collapse

Instance Method Summary collapse

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

#managerINatGet::Data::Manager (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
# File 'lib/inat-get/data/dsl/conditions/base.rb', line 20

def manager = self.model.manager

#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)

Raises:

  • (NotImplementedError)


25
# File 'lib/inat-get/data/dsl/conditions/base.rb', line 25

def model = raise NotImplementedError, "Not implemented method 'model' for abstract class.", caller_locations

Instance Method Details

#!Condition

Returns:



46
47
48
# File 'lib/inat-get/data/dsl/conditions/base.rb', line 46

def !
  NOT[ self ]
end

#&(other) ⇒ Condition

Returns:



32
33
34
35
36
# File 'lib/inat-get/data/dsl/conditions/base.rb', line 32

def & other
  return self if other == ANYTHING
  return NOTHING if other == NOTHING
  AND[ self, other ]
end

#api_queryArray<Hash>

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:

  • (Array<Hash>)


106
107
108
# File 'lib/inat-get/data/dsl/conditions/base.rb', line 106

def api_query
  normalize.simplify.send :to_api
end

#sequel_querySequel::SQL::Expression

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:

  • (Sequel::SQL::Expression)


112
113
114
# File 'lib/inat-get/data/dsl/conditions/base.rb', line 112

def sequel_query
  normalize.send :to_sequel
end

#|(other) ⇒ Condition

Returns:



39
40
41
42
43
# File 'lib/inat-get/data/dsl/conditions/base.rb', line 39

def | other
  return self if other == NOTHING
  return ANYTHING if other == ANYTHING
  OR[ self, other ]
end