Module: StructuredParams
- Defined in:
- lib/structured_params.rb,
lib/structured_params/errors.rb,
lib/structured_params/params.rb,
lib/structured_params/version.rb,
lib/structured_params/type/array.rb,
lib/structured_params/type/object.rb
Overview
rbs_inline: enabled frozen_string_literal: true
Defined Under Namespace
Modules: Type Classes: Errors, Params
Constant Summary collapse
- VERSION =
: string
'0.5.0'
Class Method Summary collapse
-
.register_types ⇒ Object
Helper method to register types : () -> void.
-
.register_types_as(object_name:, array_name:) ⇒ Object
Helper method to register types with custom names : (object_name: Symbol, array_name: Symbol) -> void.
Class Method Details
.register_types ⇒ Object
Helper method to register types : () -> void
25 26 27 28 |
# File 'lib/structured_params.rb', line 25 def self.register_types ActiveModel::Type.register(:object, StructuredParams::Type::Object) ActiveModel::Type.register(:array, StructuredParams::Type::Array) end |
.register_types_as(object_name:, array_name:) ⇒ Object
Helper method to register types with custom names : (object_name: Symbol, array_name: Symbol) -> void
32 33 34 35 |
# File 'lib/structured_params.rb', line 32 def self.register_types_as(object_name:, array_name:) ActiveModel::Type.register(object_name, StructuredParams::Type::Object) ActiveModel::Type.register(array_name, StructuredParams::Type::Array) end |