Class: YARD::Tags::TypesExplainer::CollectionType
- Defined in:
- lib/yard/tags/types_explainer.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#types ⇒ Object
Returns the value of attribute types.
Attributes inherited from Type
Instance Method Summary collapse
-
#initialize(name, types) ⇒ CollectionType
constructor
A new instance of CollectionType.
- #to_s(_singular = true) ⇒ Object
Constructor Details
#initialize(name, types) ⇒ CollectionType
Returns a new instance of CollectionType.
61 62 63 64 |
# File 'lib/yard/tags/types_explainer.rb', line 61 def initialize(name, types) @name = name @types = types end |
Instance Attribute Details
#types ⇒ Object
Returns the value of attribute types.
59 60 61 |
# File 'lib/yard/tags/types_explainer.rb', line 59 def types @types end |
Instance Method Details
#to_s(_singular = true) ⇒ Object
66 67 68 |
# File 'lib/yard/tags/types_explainer.rb', line 66 def to_s(_singular = true) "a#{name[0, 1] =~ /[aeiou]/i ? 'n' : ''} #{name} of (" + list_join(types.map {|t| t.to_s(false) }) + ")" end |