class PuppetStrings::Yard::CodeObjects::Type::Feature
Represents a resource type feature.
Attributes
docstring[R]
name[R]
Public Class Methods
new(name, docstring)
click to toggle source
Initializes a new feature. @param [String] name The name of the feature. @param [String] docstring The docstring of the feature.
# File lib/puppet-strings/yard/code_objects/type.rb, line 88 def initialize(name, docstring) @name = name @docstring = PuppetStrings::Yard::Util.scrub_string(docstring).tr("\n", ' ') end
Public Instance Methods
to_hash()
click to toggle source
Converts the feature to a hash representation. @return [Hash] Returns a hash representation of the feature.
# File lib/puppet-strings/yard/code_objects/type.rb, line 95 def to_hash hash = {} hash[:name] = name hash[:description] = docstring unless docstring.empty? hash end