Module: Voucher

Defined in:
lib/voucher.rb,
lib/voucher/cli.rb,
lib/voucher/config.rb,
lib/voucher/errors.rb,
lib/voucher/version.rb,
lib/voucher/validator.rb,
lib/voucher/model/segment.rb,
lib/voucher/model/election.rb,
lib/voucher/segments_parser.rb,
lib/voucher/segments_reader.rb,
lib/voucher/segments_builder.rb,
lib/voucher/election_contract.rb

Defined Under Namespace

Classes: CLI, Config, Election, ElectionContract, InvalidSegment, RootHashNotFound, Segment, SegmentsBuilder, SegmentsParser, SegmentsReader, Validator, VoucherError

Constant Summary collapse

VERSION =
'0.2.1'

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configObject



26
27
28
# File 'lib/voucher.rb', line 26

def self.config
  @config ||= Config.new
end

Class Method Details

.configure(options = {}) ⇒ Object



34
35
36
37
38
39
40
41
42
# File 'lib/voucher.rb', line 34

def self.configure(options = {})
  return yield(config) if block_given?

  options = options.with_indifferent_access

  config.ethereum_url = options['host'] if options['host']

  config
end

.resetObject



30
31
32
# File 'lib/voucher.rb', line 30

def self.reset
  @config = Config.new
end