Class: YARD::Tags::OverloadTag
Instance Attribute Summary collapse
-
#docstring ⇒ Object
readonly
Returns the value of attribute docstring.
-
#name ⇒ String
inherited
from Tag
A name associated with the tag.
-
#object ⇒ CodeObjects::Base
inherited
from Tag
The associated object.
-
#parameters ⇒ Object
readonly
Returns the value of attribute parameters.
-
#signature ⇒ Object
readonly
Returns the value of attribute signature.
-
#tag_name ⇒ String
inherited
from Tag
The name of the tag.
- #text ⇒ String? inherited from Tag
- #types ⇒ Array<String>? inherited from Tag
Instance Method Summary collapse
- #has_tag?(name) ⇒ Boolean
-
#initialize(tag_name, text) ⇒ OverloadTag
constructor
A new instance of OverloadTag.
- #is_a?(other) ⇒ Boolean (also: #kind_of?)
- #method_missing(*args, &block) ⇒ Object
- #name(prefix = false) ⇒ Object
- #object=(value) ⇒ Object
- #tag(name) ⇒ Object
- #tags(name = nil) ⇒ Object
- #type ⇒ Object
Constructor Details
#initialize(tag_name, text) ⇒ OverloadTag
Returns a new instance of OverloadTag
6 7 8 9 10 |
# File 'lib/yard/tags/overload_tag.rb', line 6 def initialize(tag_name, text) super(tag_name, nil) parse_tag(text) parse_signature end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(*args, &block) ⇒ Object
27 28 29 |
# File 'lib/yard/tags/overload_tag.rb', line 27 def method_missing(*args, &block) object.send(*args, &block) end |
Instance Attribute Details
#docstring ⇒ Object (readonly)
Returns the value of attribute docstring
4 5 6 |
# File 'lib/yard/tags/overload_tag.rb', line 4 def docstring @docstring end |
#object ⇒ CodeObjects::Base Originally defined in class Tag
Returns the associated object
#parameters ⇒ Object (readonly)
Returns the value of attribute parameters
4 5 6 |
# File 'lib/yard/tags/overload_tag.rb', line 4 def parameters @parameters end |
#signature ⇒ Object (readonly)
Returns the value of attribute signature
4 5 6 |
# File 'lib/yard/tags/overload_tag.rb', line 4 def signature @signature end |
Instance Method Details
#has_tag?(name) ⇒ Boolean
14 |
# File 'lib/yard/tags/overload_tag.rb', line 14 def has_tag?(name) docstring.has_tag?(name) end |
#is_a?(other) ⇒ Boolean Also known as: kind_of?
35 36 37 |
# File 'lib/yard/tags/overload_tag.rb', line 35 def is_a?(other) object.is_a?(other) || self.class >= other.class || false end |
#name(prefix = false) ⇒ Object
22 23 24 25 |
# File 'lib/yard/tags/overload_tag.rb', line 22 def name(prefix = false) return @name unless prefix object.scope == :class ? @name.to_s : "#{object.send(:sep)}#{@name}" end |
#object=(value) ⇒ Object
16 17 18 19 20 |
# File 'lib/yard/tags/overload_tag.rb', line 16 def object=(value) super(value) docstring.object = value docstring..each {|tag| tag.object = value } end |
#tag(name) ⇒ Object
12 |
# File 'lib/yard/tags/overload_tag.rb', line 12 def tag(name) docstring.tag(name) end |
#tags(name = nil) ⇒ Object
13 |
# File 'lib/yard/tags/overload_tag.rb', line 13 def (name = nil) docstring.(name) end |
#type ⇒ Object
31 32 33 |
# File 'lib/yard/tags/overload_tag.rb', line 31 def type object.type end |