Module: Barton
- Defined in:
- lib/barton.rb,
lib/barton/app.rb,
lib/barton/core.rb,
lib/barton/version.rb
Defined Under Namespace
Modules: Data, Find, Setup Classes: App
Constant Summary collapse
- VERSION =
"0.0.2"
Class Method Summary collapse
-
.config ⇒ Object
Configuration options for the Gem.
- .data_loaded ⇒ Object
- .data_loaded=(bool) ⇒ Object
-
.electorates(query = {}) ⇒ Object
Returns an array of electorates matching the search criteria Accepts a hash of criteria :id :tags :geo :address Returns an array of hashes.
-
.setup ⇒ Object
Loads electoral data from the yaml files into elasticsearch.
Instance Method Summary collapse
-
#members ⇒ Object
Returns an array of member matching the search criteria Accepts a hash of criteria Returns an array of hashes.
Class Method Details
.config ⇒ Object
Configuration options for the Gem
38 39 40 41 |
# File 'lib/barton/core.rb', line 38 def self.config #puts ENV['RAKE_ENV'] #Data.config end |
.data_loaded ⇒ Object
5 6 7 |
# File 'lib/barton.rb', line 5 def data_loaded @@data_loaded ||= false end |
.data_loaded=(bool) ⇒ Object
9 10 11 |
# File 'lib/barton.rb', line 9 def data_loaded=(bool) @@data_loaded = bool end |
.electorates(query = {}) ⇒ Object
Returns an array of electorates matching the search criteria
Accepts a hash of criteria
:id
:tags
:geo
:address
Returns an array of hashes
16 17 18 |
# File 'lib/barton/core.rb', line 16 def Barton.electorates( query = {} ) Find.electorates( query ) end |
Instance Method Details
#members ⇒ Object
Returns an array of member matching the search criteria
Accepts a hash of criteria
Returns an array of hashes
23 24 25 |
# File 'lib/barton/core.rb', line 23 def members # TBA end |