Class: PuppetStrings::Yard::CodeObjects::DataTypeAlias
- Inherits:
-
Base
- Object
- YARD::CodeObjects::NamespaceObject
- Base
- PuppetStrings::Yard::CodeObjects::DataTypeAlias
- Defined in:
- lib/puppet-strings/yard/code_objects/data_type_alias.rb
Overview
Implements the Puppet DataTypeAlias code object.
Instance Attribute Summary collapse
-
#alias_of ⇒ Object
Returns the value of attribute alias_of.
-
#statement ⇒ Object
readonly
Returns the value of attribute statement.
Instance Method Summary collapse
-
#initialize(statement) ⇒ void
constructor
Initializes a Puppet data type alias code object.
-
#source ⇒ Object
Gets the source of the code object.
-
#to_hash ⇒ Hash
Converts the code object to a hash representation.
-
#type ⇒ Object
Gets the type of the code object.
Methods inherited from Base
Constructor Details
#initialize(statement) ⇒ void
Initializes a Puppet data type alias code object.
28 29 30 31 32 |
# File 'lib/puppet-strings/yard/code_objects/data_type_alias.rb', line 28 def initialize(statement) @statement = statement @alias_of = statement.alias_of super(PuppetStrings::Yard::CodeObjects::DataTypeAliases.instance, statement.name) end |
Instance Attribute Details
#alias_of ⇒ Object
Returns the value of attribute alias_of.
23 24 25 |
# File 'lib/puppet-strings/yard/code_objects/data_type_alias.rb', line 23 def alias_of @alias_of end |
#statement ⇒ Object (readonly)
Returns the value of attribute statement.
22 23 24 |
# File 'lib/puppet-strings/yard/code_objects/data_type_alias.rb', line 22 def statement @statement end |
Instance Method Details
#source ⇒ Object
Gets the source of the code object.
42 43 44 45 |
# File 'lib/puppet-strings/yard/code_objects/data_type_alias.rb', line 42 def source # Not implemented, but would be nice! nil end |
#to_hash ⇒ Hash
Converts the code object to a hash representation.
49 50 51 52 53 54 55 56 57 |
# File 'lib/puppet-strings/yard/code_objects/data_type_alias.rb', line 49 def to_hash hash = {} hash[:name] = name hash[:file] = file hash[:line] = line hash[:docstring] = PuppetStrings::Yard::Util.docstring_to_hash(docstring) hash[:alias_of] = alias_of hash end |
#type ⇒ Object
Gets the type of the code object.
36 37 38 |
# File 'lib/puppet-strings/yard/code_objects/data_type_alias.rb', line 36 def type :puppet_data_type_alias end |