Module: Tinge::Reporters

Defined in:
lib/tinge/reporters.rb,
lib/tinge/reporters/reporter.rb,
lib/tinge/reporters/variables_reporter.rb

Defined Under Namespace

Classes: MissingReporterError, Reporter, VariablesReporter

Class Method Summary collapse

Class Method Details

.add(style, reporter) ⇒ Object



19
20
21
# File 'lib/tinge/reporters.rb', line 19

def self.add(style, reporter)
  reporters[style.to_sym] = reporter
end

.find(style) ⇒ Object



6
7
8
9
10
11
12
13
# File 'lib/tinge/reporters.rb', line 6

def self.find(style)
  reporter = reporters[style.to_sym]
  if reporter
    reporter
  else
    raise MissingReporterError, style.to_s
  end
end

.reportersObject



23
24
25
# File 'lib/tinge/reporters.rb', line 23

def self.reporters
  @reporters ||= {}
end

.validObject



15
16
17
# File 'lib/tinge/reporters.rb', line 15

def self.valid
  reporters.keys.map(&:to_s)
end