Class: Decidim::DecidimAwesome::SpaceConstraintFinder

Inherits:
Object
  • Object
show all
Defined in:
app/queries/decidim/decidim_awesome/space_constraint_finder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config_var, participatory_space) ⇒ SpaceConstraintFinder

Returns a new instance of SpaceConstraintFinder.



6
7
8
9
# File 'app/queries/decidim/decidim_awesome/space_constraint_finder.rb', line 6

def initialize(config_var, participatory_space)
  @config_var = config_var
  @participatory_space = participatory_space
end

Instance Attribute Details

#config_varObject (readonly)

Returns the value of attribute config_var.



11
12
13
# File 'app/queries/decidim/decidim_awesome/space_constraint_finder.rb', line 11

def config_var
  @config_var
end

#participatory_spaceObject (readonly)

Returns the value of attribute participatory_space.



11
12
13
# File 'app/queries/decidim/decidim_awesome/space_constraint_finder.rb', line 11

def participatory_space
  @participatory_space
end

Instance Method Details

#queryObject



13
14
15
16
17
18
# File 'app/queries/decidim/decidim_awesome/space_constraint_finder.rb', line 13

def query
  return Decidim::DecidimAwesome::AwesomeConfig.none if participatory_space.nil?

  set_base_query
  add_space_specific_conditions
end