Module: BallotBox

Defined in:
lib/ballot_box.rb,
lib/ballot_box/base.rb,
lib/ballot_box/config.rb,
lib/ballot_box/engine.rb,
lib/ballot_box/voting.rb,
lib/ballot_box/manager.rb,
lib/ballot_box/version.rb,
lib/ballot_box/callbacks.rb,
app/models/ballot_box/vote.rb,
lib/ballot_box/strategies/base.rb,
lib/ballot_box/strategies/authenticated.rb,
lib/generators/ballot_box/install_generator.rb

Defined Under Namespace

Modules: Base, Callbacks, Generators, Strategies, Voting Classes: Config, Engine, Manager, Vote

Constant Summary collapse

VERSION =
"0.1.9"

Class Method Summary collapse

Class Method Details

.load_strategy(name) ⇒ Object



18
19
20
21
22
23
24
# File 'lib/ballot_box.rb', line 18

def self.load_strategy(name)
  case name.class.name
    when "Symbol" then "BallotBox::Strategies::#{name.to_s.classify}".constantize
    when "String" then name.classify.constantize
    else name
  end
end

.table_name_prefixObject



14
15
16
# File 'lib/ballot_box.rb', line 14

def self.table_name_prefix
  'ballot_box_'
end