Class: SoberSwag::Reporting::Output::Base

Inherits:
Object
  • Object
show all
Includes:
Interface
Defined in:
lib/sober_swag/reporting/output/base.rb

Overview

Base type for simple outputs.

Instance Method Summary collapse

Methods included from Interface

#call!, #described, #enum, #in_range, #list, #nilable, #partitioned, #referenced, #reporting?, #serialize, #via_map

Instance Method Details

#view(view_key) ⇒ Object

Raises:

  • (ArgumentError)


17
18
19
20
21
# File 'lib/sober_swag/reporting/output/base.rb', line 17

def view(view_key)
  return self if view_key == :base

  raise ArgumentError, "#{view_key} is not a view" unless views.include?(view_key)
end

#viewsSet<Symbol>

Acceptable views to use with this output.

Returns:

  • (Set<Symbol>)

    the views



13
14
15
# File 'lib/sober_swag/reporting/output/base.rb', line 13

def views
  %i[base].to_set
end