Class: Heroics::Parameter
- Inherits:
-
Object
- Object
- Heroics::Parameter
- Defined in:
- lib/heroics/schema.rb
Overview
A representation of a parameter.
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#resource_name ⇒ Object
readonly
Returns the value of attribute resource_name.
Instance Method Summary collapse
-
#initialize(resource_name, name, description) ⇒ Parameter
constructor
A new instance of Parameter.
-
#inspect ⇒ Object
A pretty representation of this instance.
-
#name ⇒ Object
The name of the parameter, with the resource included, suitable for use in a function signature.
Constructor Details
#initialize(resource_name, name, description) ⇒ Parameter
Returns a new instance of Parameter.
366 367 368 369 370 |
# File 'lib/heroics/schema.rb', line 366 def initialize(resource_name, name, description) @resource_name = Heroics.ruby_name(resource_name) @name = Heroics.ruby_name(name) @description = description end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
364 365 366 |
# File 'lib/heroics/schema.rb', line 364 def description @description end |
#resource_name ⇒ Object (readonly)
Returns the value of attribute resource_name.
364 365 366 |
# File 'lib/heroics/schema.rb', line 364 def resource_name @resource_name end |
Instance Method Details
#inspect ⇒ Object
A pretty representation of this instance.
379 380 381 |
# File 'lib/heroics/schema.rb', line 379 def inspect "Parameter(name=#{@name}, description=#{@description})" end |
#name ⇒ Object
The name of the parameter, with the resource included, suitable for use in a function signature.
374 375 376 |
# File 'lib/heroics/schema.rb', line 374 def name [@resource_name, @name].compact.join("_") end |