mirror of
https://github.com/ditkrg/schemable.git
synced 2026-01-22 22:26:41 +00:00
Uses attribute reader instead of accessor
This commit is contained in:
parent
dcfc80d9ad
commit
b8928ee1ea
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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])
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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]])
|
||||
|
||||
@ -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]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user