Class: TableStructure::Utils::TypedProc
- Defined in:
- lib/table_structure/utils.rb
Instance Attribute Summary
Attributes inherited from Proc
Instance Method Summary collapse
-
#initialize(types:, **options, &block) ⇒ TypedProc
constructor
A new instance of TypedProc.
- #typed?(type) ⇒ Boolean
Constructor Details
#initialize(types:, **options, &block) ⇒ TypedProc
Returns a new instance of TypedProc.
15 16 17 18 |
# File 'lib/table_structure/utils.rb', line 15 def initialize(types:, **, &block) @types = [types].flatten.compact super(**, &block) end |
Instance Method Details
#typed?(type) ⇒ Boolean
20 21 22 |
# File 'lib/table_structure/utils.rb', line 20 def typed?(type) @types.include?(type) end |