class PuppetX::PuppetLabs::Strings::YARD::CodeObjects::DefinedTypeObject

Attributes

parameters[RW]

A list of parameters attached to this class. @return [Array<Array(String, String)>]

type_info[RW]

Public Instance Methods

to_json(*a) click to toggle source
# File lib/puppet_x/puppetlabs/strings/yard/code_objects/defined_type_object.rb, line 13
def to_json(*a)
  {
    "name"             => @name,
    "file"             => file,
    "line"             => line,
    "parameters"       => Hash[@parameters],
    "docstring"        => Puppet::Util::Docs.scrub(@docstring),
    "signatures"       => @type_info.map do |signature|
      signature.map do |key, value|
        {
          "name" => key,
          "type" => value,
        }
      end
    end,
    "examples"              => self.tags.map do |tag|
        tag.text if tag.tag_name == 'example'
    end.compact,
  }.to_json(*a)
end
to_s() click to toggle source
# File lib/puppet_x/puppetlabs/strings/yard/code_objects/defined_type_object.rb, line 9
def to_s
  name.to_s
end