Uses attribute reader instead of accessor

This commit is contained in:
Muhammad Nawzad 2023-11-13 15:50:28 +03:00
parent dcfc80d9ad
commit b8928ee1ea
No known key found for this signature in database
GPG Key ID: B954B6AAE33940B2
10 changed files with 21 additions and 24 deletions

View File

@ -1,6 +1,6 @@
module Schemable
class AttributeSchemaGenerator
attr_accessor :model_definition, :configuration, :model, :schema_modifier, :response
attr_reader :model_definition, :configuration, :model, :schema_modifier, :response
def initialize(model_definition)
@model_definition = model_definition

View File

@ -1,6 +1,6 @@
module Schemable
class IncludedSchemaGenerator
attr_accessor :model_definition, :schema_modifier, :relationships
attr_reader :model_definition, :schema_modifier, :relationships
def initialize(model_definition)
@model_definition = model_definition

View File

@ -1,6 +1,6 @@
module Schemable
class RelationshipSchemaGenerator
attr_accessor :model_definition, :schema_modifier, :relationships
attr_reader :model_definition, :schema_modifier, :relationships
def initialize(model_definition)
@model_definition = model_definition

View File

@ -1,6 +1,6 @@
module Schemable
class RequestSchemaGenerator
attr_accessor :model_definition, :schema_modifier
attr_reader :model_definition, :schema_modifier
def initialize(model_definition)
@model_definition = model_definition

View File

@ -1,6 +1,6 @@
module Schemable
class ResponseSchemaGenerator
attr_accessor :model_definition, :model
attr_reader :model_definition, :model, :schema_modifier
def initialize(model_definition)
@model_definition = model_definition

View File

@ -1,10 +1,10 @@
module Schemable
class AttributeSchemaGenerator
attr_accessor model: Class
attr_accessor model_definition: Definition
attr_accessor configuration: Configuration
attr_accessor response: Hash[Symbol, any]?
attr_accessor schema_modifier: SchemaModifier
attr_reader model: Class
attr_reader model_definition: Definition
attr_reader configuration: Configuration
attr_reader response: Hash[Symbol, any]?
attr_reader schema_modifier: SchemaModifier
def initialize: (Definition) -> void
def generate: -> (Hash[Symbol, any] | Array[any])

View File

@ -1,11 +1,8 @@
module Schemable
class IncludedSchemaGenerator
attr_accessor expand: bool
attr_accessor model_definition: Definition
attr_accessor configuration: Configuration
attr_accessor schema_modifier: SchemaModifier
attr_accessor relationships: Hash[Symbol, any]
attr_accessor relationships_to_exclude_from_expansion: Array[String]
attr_reader model_definition: Definition
attr_reader schema_modifier: SchemaModifier
attr_reader relationships: Hash[Symbol, any]
def initialize: (Definition) -> void

View File

@ -1,8 +1,8 @@
module Schemable
class RelationshipSchemaGenerator
attr_accessor model_definition: Definition
attr_accessor schema_modifier: SchemaModifier
attr_accessor relationships: Hash[Symbol, any]
attr_reader model_definition: Definition
attr_reader schema_modifier: SchemaModifier
attr_reader relationships: Hash[Symbol, any]
def initialize: (Definition) -> void

View File

@ -1,7 +1,7 @@
module Schemable
class RequestSchemaGenerator
attr_accessor model_definition: Definition
attr_accessor schema_modifier: SchemaModifier
attr_reader model_definition: Definition
attr_reader schema_modifier: SchemaModifier
def initialize: (Definition) -> void
def generate_for_create: () -> (Hash[Symbol, any] | Array[Hash[Symbol, any]])

View File

@ -1,8 +1,8 @@
module Schemable
class ResponseSchemaGenerator
attr_accessor model: Class
attr_accessor model_definition: Definition
attr_accessor schema_modifier: SchemaModifier
attr_reader model: Class
attr_reader model_definition: Definition
attr_reader schema_modifier: SchemaModifier
def initialize: (Definition) -> void
def meta: -> Hash[Symbol, any]