Ensures type safety

This commit is contained in:
Muhammad Nawzad 2023-11-17 16:11:20 +03:00
parent dc89944058
commit 6908df347a
No known key found for this signature in database
GPG Key ID: B954B6AAE33940B2
5 changed files with 6 additions and 10 deletions

View File

@ -297,7 +297,7 @@ module Schemable
#
# @param hash [Hash] The hash with all the keys camelized.
#
# @return [Hash] The hash with all the keys camelized.
# @return [Hash, Array] The hash with all the keys camelized.
#
# @example
# { first_name: 'John', last_name: 'Doe' } => { firstName: 'John', lastName: 'Doe' }

View File

@ -25,8 +25,8 @@ module Schemable
def excluded_update_request_attributes: -> Array[Symbol]
def optional_create_request_attributes: -> Array[Symbol]
def optional_update_request_attributes: -> Array[Symbol]
def camelize_keys: (Hash[Symbol, any]) -> (Hash[Symbol, any])
def additional_create_request_attributes: -> Hash[Symbol, any]
def additional_update_request_attributes: -> Hash[Symbol, any]
def camelize_keys: (Hash[Symbol, any]) -> (Array[Hash[Symbol, any]] | Hash[Symbol, any])
end
end

View File

@ -5,9 +5,7 @@ module Schemable
attr_reader relationships: Hash[Symbol, any]
def initialize: (Definition) -> void
def generate: (?relationships_to_exclude_from_expansion: Array[String], ?expand: bool) -> (Hash[Symbol, any])
def prepare_schema_for_included: (Definition, ?relationships_to_exclude_from_expansion: Array[String], ?expand: bool) -> Hash[Symbol, any]
def generate: (?relationships_to_exclude_from_expansion: Array[String], ?expand: bool) -> (Hash[Symbol, any] | Array[Hash[Symbol, any]])
end
end

View File

@ -5,9 +5,7 @@ module Schemable
attr_reader relationships: Hash[Symbol, any]
def initialize: (Definition) -> void
def generate: (?relationships_to_exclude_from_expansion: Array[String], ?expand: bool) -> (Hash[Symbol, any] | Array[Hash[Symbol, any]])
def generate_schema: (String, ?collection: bool) -> Hash[Symbol, any]
def generate: (?relationships_to_exclude_from_expansion: Array[String], ?expand: bool) -> (Hash[Symbol, any])
end
end

View File

@ -4,7 +4,7 @@ module Schemable
attr_reader schema_modifier: SchemaModifier
def initialize: (Definition) -> void
def generate_for_create: () -> (Hash[Symbol, any] | Array[Hash[Symbol, any]])
def generate_for_update: () -> (Hash[Symbol, any] | Array[Hash[Symbol, any]])
def generate_for_create: () -> (Hash[Symbol, any])
def generate_for_update: () -> (Hash[Symbol, any])
end
end