Class: YARD::Tags::TypesExplainer::Type Private
Do not use. This class is for internal use only.
| Relationships & Source Files | |
| Extension / Inclusion / Inheritance Descendants | |
|
Subclasses:
YARD::Tags::TypesExplainer::CollectionType, YARD::Tags::TypesExplainer::FixedCollectionType, YARD::Tags::TypesExplainer::HashCollectionType
|
|
| Inherits: | Object |
| Defined in: | lib/yard/tags/types_explainer.rb |
Class Method Summary
- .new(name) ⇒ Type constructor Internal use only
Instance Attribute Summary
- #name rw Internal use only
Instance Method Summary
- #to_s(singular = true) Internal use only
- #list_join(list, with: "or") private Internal use only
Instance Attribute Details
#name (rw)
[ GitHub ]# File 'lib/yard/tags/types_explainer.rb', line 27
attr_accessor :name
Instance Method Details
#list_join(list, with: "or") (private)
[ GitHub ]#to_s(singular = true)
[ GitHub ]# File 'lib/yard/tags/types_explainer.rb', line 33
def to_s(singular = true) if name[0, 1] == "#" (singular ? "an object that responds to " : "objects that respond to ") + list_join(name.split(/ *& */), with: "and") elsif name[0, 1] =~ /[A-Z]/ singular ? "a#{name[0, 1] =~ /[aeiou]/i ? 'n' : ''} " + name : "#{name}#{name[-1, 1] =~ /[A-Z]/ ? "'" : ''}s" else name end end