Class: TypeSpecFromSerializers::Resource
- Inherits:
-
Struct
- Object
- Struct
- TypeSpecFromSerializers::Resource
- Defined in:
- lib/typespec_from_serializers/generator.rb
Overview
Internal: Represents a TypeSpec resource interface
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#operations ⇒ Object
Returns the value of attribute operations.
-
#path ⇒ Object
Returns the value of attribute path.
Instance Method Summary collapse
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name
222 223 224 |
# File 'lib/typespec_from_serializers/generator.rb', line 222 def name @name end |
#operations ⇒ Object
Returns the value of attribute operations
222 223 224 |
# File 'lib/typespec_from_serializers/generator.rb', line 222 def operations @operations end |
#path ⇒ Object
Returns the value of attribute path
222 223 224 |
# File 'lib/typespec_from_serializers/generator.rb', line 222 def path @path end |
Instance Method Details
#as_typespec ⇒ Object
223 224 225 226 227 228 229 230 |
# File 'lib/typespec_from_serializers/generator.rb', line 223 def as_typespec <<~TSP #{" " * 1}@route("#{path}") #{" " * 1}interface #{name} { #{" " * 1}#{operations.map(&:as_typespec).join("\n ")} #{" " * 1}} TSP end |