Class: PuppetStrings::Yard::CodeObjects::Type::Feature
- Inherits:
-
Object
- Object
- PuppetStrings::Yard::CodeObjects::Type::Feature
- Defined in:
- lib/puppet-strings/yard/code_objects/type.rb
Overview
Represents a resource type feature.
Instance Attribute Summary collapse
-
#docstring ⇒ Object
readonly
Returns the value of attribute docstring.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name, docstring) ⇒ Feature
constructor
Initializes a new feature.
-
#to_hash ⇒ Hash
Converts the feature to a hash representation.
Constructor Details
#initialize(name, docstring) ⇒ Feature
Initializes a new feature.
79 80 81 82 |
# File 'lib/puppet-strings/yard/code_objects/type.rb', line 79 def initialize(name, docstring) @name = name @docstring = docstring end |
Instance Attribute Details
#docstring ⇒ Object (readonly)
Returns the value of attribute docstring.
74 75 76 |
# File 'lib/puppet-strings/yard/code_objects/type.rb', line 74 def docstring @docstring end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
74 75 76 |
# File 'lib/puppet-strings/yard/code_objects/type.rb', line 74 def name @name end |
Instance Method Details
#to_hash ⇒ Hash
Converts the feature to a hash representation.
86 87 88 89 90 91 |
# File 'lib/puppet-strings/yard/code_objects/type.rb', line 86 def to_hash hash = {} hash[:name] = name hash[:description] = docstring unless docstring.empty? hash end |