Class: Shaf::Yard::AttributeObject

Inherits:
YARD::CodeObjects::Base
  • Object
show all
Defined in:
lib/shaf/yard/attribute_object.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#nameObject

Returns the value of attribute name.



6
7
8
# File 'lib/shaf/yard/attribute_object.rb', line 6

def name
  @name
end

Instance Method Details

#descriptorObject



25
26
27
# File 'lib/shaf/yard/attribute_object.rb', line 25

def descriptor
  profile&.find_attribute(name)
end

#documentationObject



8
9
10
# File 'lib/shaf/yard/attribute_object.rb', line 8

def documentation
  profile_doc || 'Not documented'
end

#profileObject



12
13
14
15
# File 'lib/shaf/yard/attribute_object.rb', line 12

def profile
  return unless namespace.respond_to? :profile
  @profile ||= namespace.profile
end

#profile_docObject



21
22
23
# File 'lib/shaf/yard/attribute_object.rb', line 21

def profile_doc
  descriptor&.doc
end

#value_typesObject



17
18
19
# File 'lib/shaf/yard/attribute_object.rb', line 17

def value_types
  Array(descriptor&.type).compact.map(&:to_s)
end