Class: SoberSwag::Reporting::Output::Base
- Inherits:
-
Object
- Object
- SoberSwag::Reporting::Output::Base
- Includes:
- Interface
- Defined in:
- lib/sober_swag/reporting/output/base.rb
Overview
Base type for simple outputs.
Direct Known Subclasses
Bool, Defer, Described, Dictionary, Enum, InRange, List, MergeObjects, Null, Number, Object, Partitioned, Pattern, Referenced, Text, ViaMap, Viewed
Instance Method Summary collapse
- #view(view_key) ⇒ Object
-
#views ⇒ Set<Symbol>
Acceptable views to use with this output.
Methods included from Interface
#call!, #described, #enum, #in_range, #list, #nilable, #partitioned, #referenced, #reporting?, #serialize, #via_map
Instance Method Details
#view(view_key) ⇒ Object
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 |
#views ⇒ Set<Symbol>
Acceptable views to use with this output.
13 14 15 |
# File 'lib/sober_swag/reporting/output/base.rb', line 13 def views %i[base].to_set end |