Class: GraphQL::Rails::ActiveReflection::AttributeReflection
- Inherits:
-
Object
- Object
- GraphQL::Rails::ActiveReflection::AttributeReflection
- Defined in:
- lib/graphql/rails/active_reflection/attribute_reflection.rb
Class Attribute Summary collapse
-
.schema_name ⇒ Object
Returns the value of attribute schema_name.
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#klass ⇒ Object
readonly
Returns the value of attribute klass.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#validators ⇒ Object
readonly
Returns the value of attribute validators.
Instance Method Summary collapse
-
#initialize(field, klass, schema) ⇒ AttributeReflection
constructor
A new instance of AttributeReflection.
Constructor Details
#initialize(field, klass, schema) ⇒ AttributeReflection
Returns a new instance of AttributeReflection.
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/graphql/rails/active_reflection/attribute_reflection.rb', line 12 def initialize(field, klass, schema) @klass = klass @name = field.property || field.name @validators = klass.validators.map { |validator| return nil if validator.attributes.exclude? @name return nil if validator.[:if].present? return nil if validator.[:unless].present? ValidatorReflection.new(validator) }.compact @errors = [] end |
Class Attribute Details
.schema_name ⇒ Object
Returns the value of attribute schema_name.
26 27 28 |
# File 'lib/graphql/rails/active_reflection/attribute_reflection.rb', line 26 def schema_name @schema_name end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
9 10 11 |
# File 'lib/graphql/rails/active_reflection/attribute_reflection.rb', line 9 def description @description end |
#klass ⇒ Object (readonly)
Returns the value of attribute klass.
7 8 9 |
# File 'lib/graphql/rails/active_reflection/attribute_reflection.rb', line 7 def klass @klass end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/graphql/rails/active_reflection/attribute_reflection.rb', line 8 def name @name end |
#validators ⇒ Object (readonly)
Returns the value of attribute validators.
10 11 12 |
# File 'lib/graphql/rails/active_reflection/attribute_reflection.rb', line 10 def validators @validators end |