Class: Heroics::GeneratorResource

Inherits:
Object
  • Object
show all
Defined in:
lib/heroics/client_generator.rb

Overview

A representation of a resource for use when generating source code in the template.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, description, links) ⇒ GeneratorResource

Returns a new instance of GeneratorResource.



50
51
52
53
54
# File 'lib/heroics/client_generator.rb', line 50

def initialize(name, description, links)
  @name = Heroics.ruby_name(name)
  @description = description
  @links = links
end

Instance Attribute Details

#descriptionObject (readonly)

Returns the value of attribute description.



48
49
50
# File 'lib/heroics/client_generator.rb', line 48

def description
  @description
end

Returns the value of attribute links.



48
49
50
# File 'lib/heroics/client_generator.rb', line 48

def links
  @links
end

#nameObject (readonly)

Returns the value of attribute name.



48
49
50
# File 'lib/heroics/client_generator.rb', line 48

def name
  @name
end

Instance Method Details

#class_nameObject

The name of the resource class in generated code.



57
58
59
# File 'lib/heroics/client_generator.rb', line 57

def class_name
  Heroics.camel_case(name)
end