Class: Graphiti::OpenAPI::Attribute
- Inherits:
-
AttributeData
- Object
- Dry::Struct
- Struct
- AttributeData
- Graphiti::OpenAPI::Attribute
- Defined in:
- app/models/graphiti/open_api/attribute.rb
Instance Method Summary collapse
Instance Method Details
#to_property ⇒ Object
22 23 24 25 26 27 28 29 30 |
# File 'app/models/graphiti/open_api/attribute.rb', line 22 def to_property return {} unless readable || writable definition = type.to_schema definition[:description] = description if description definition[:readOnly] = readable unless writable definition[:writeOnly] = writable unless readable {name => definition} end |
#type ⇒ Object
18 19 20 |
# File 'app/models/graphiti/open_api/attribute.rb', line 18 def type schema.types[__attributes__[:type].to_sym] end |