Class: Atum::Generation::GeneratorResource
- Inherits:
-
Object
- Object
- Atum::Generation::GeneratorResource
- Defined in:
- lib/atum/generation/generator_resource.rb
Instance Method Summary collapse
-
#class_name ⇒ Object
The name of the resource class in generated code.
-
#description ⇒ Object
Description of the resource.
-
#initialize(resource_schema) ⇒ GeneratorResource
constructor
A new instance of GeneratorResource.
-
#links ⇒ Object
Links available on this resource.
-
#name ⇒ Object
The name of the resource, in snake case.
Constructor Details
#initialize(resource_schema) ⇒ GeneratorResource
Returns a new instance of GeneratorResource.
4 5 6 |
# File 'lib/atum/generation/generator_resource.rb', line 4 def initialize(resource_schema) @resource_schema = resource_schema end |
Instance Method Details
#class_name ⇒ Object
The name of the resource class in generated code.
26 27 28 |
# File 'lib/atum/generation/generator_resource.rb', line 26 def class_name name.camelcase end |
#description ⇒ Object
Description of the resource.
14 15 16 |
# File 'lib/atum/generation/generator_resource.rb', line 14 def description @resource_schema.description end |
#links ⇒ Object
Links available on this resource.
19 20 21 22 23 |
# File 'lib/atum/generation/generator_resource.rb', line 19 def links @links ||= @resource_schema.link_schemas.map do |link_schema| GeneratorLink.new(link_schema) end end |
#name ⇒ Object
The name of the resource, in snake case.
9 10 11 |
# File 'lib/atum/generation/generator_resource.rb', line 9 def name @resource_schema.name.gsub('-', '_') end |