Class: Yoda::Model::Descriptions::FunctionDescription
- Defined in:
- lib/yoda/model/descriptions/function_description.rb
Instance Attribute Summary collapse
- #function ⇒ FunctionSignatures::Base readonly
Instance Method Summary collapse
-
#initialize(function) ⇒ FunctionDescription
constructor
A new instance of FunctionDescription.
- #label ⇒ Object
- #parameter_names ⇒ Object
- #signature ⇒ Object
- #sort_text ⇒ Object
- #title ⇒ Object
- #to_markdown ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(function) ⇒ FunctionDescription
Returns a new instance of FunctionDescription.
9 10 11 12 |
# File 'lib/yoda/model/descriptions/function_description.rb', line 9 def initialize(function) fail ArgumentError, function unless function.is_a?(FunctionSignatures::Wrapper) @function = function end |
Instance Attribute Details
#function ⇒ FunctionSignatures::Base (readonly)
6 7 8 |
# File 'lib/yoda/model/descriptions/function_description.rb', line 6 def function @function end |
Instance Method Details
#label ⇒ Object
18 19 20 |
# File 'lib/yoda/model/descriptions/function_description.rb', line 18 def label signature end |
#parameter_names ⇒ Object
30 31 32 |
# File 'lib/yoda/model/descriptions/function_description.rb', line 30 def parameter_names function.parameters.parameter_names end |
#signature ⇒ Object
22 23 24 |
# File 'lib/yoda/model/descriptions/function_description.rb', line 22 def signature "#{function.to_s}" end |
#sort_text ⇒ Object
26 27 28 |
# File 'lib/yoda/model/descriptions/function_description.rb', line 26 def sort_text function.name.to_s end |
#title ⇒ Object
14 15 16 |
# File 'lib/yoda/model/descriptions/function_description.rb', line 14 def title "#{function.namespace_path}#{function.sep}#{function.to_s}" end |
#to_markdown ⇒ Object
34 35 36 37 38 39 40 41 |
# File 'lib/yoda/model/descriptions/function_description.rb', line 34 def to_markdown <<~EOS **#{title}** #{function.document} #{tag_documents} EOS end |