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.3"
Class Method Summary collapse
- .api_url ⇒ Object
- .api_url=(env) ⇒ Object
- .config ⇒ 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.
- .environment ⇒ Object
- .environment=(env) ⇒ Object
-
.members(query = {}) ⇒ Object
Returns an array of member matching the search criteria Accepts a hash of criteria Returns an array of hashes.
-
.setup ⇒ Object
Loads electoral data from the yaml files into elasticsearch.
Class Method Details
.api_url ⇒ Object
14 15 16 |
# File 'lib/barton.rb', line 14 def api_url @@api_url ||= 'http://localhost:4567' end |
.api_url=(env) ⇒ Object
18 19 20 |
# File 'lib/barton.rb', line 18 def api_url=(env) @@api_url = env 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 self.electorates( query = {} ) Find.electorates( query ) end |
.environment ⇒ Object
5 6 7 |
# File 'lib/barton.rb', line 5 def environment @@environment = ENV['BARTON'] || 'development' end |
.environment=(env) ⇒ Object
9 10 11 12 |
# File 'lib/barton.rb', line 9 def environment=(env) ENV['BARTON'] = env @@environment = env end |