Class: YARD::Tags::TypesExplainer::HashCollectionType
- Defined in:
- lib/yard/tags/types_explainer.rb
Instance Attribute Summary collapse
-
#key_types ⇒ Object
Returns the value of attribute key_types.
-
#value_types ⇒ Object
Returns the value of attribute value_types.
Attributes inherited from Type
Instance Method Summary collapse
-
#initialize(name, key_types, value_types) ⇒ HashCollectionType
constructor
A new instance of HashCollectionType.
- #to_s(_singular = true) ⇒ Object
Constructor Details
#initialize(name, key_types, value_types) ⇒ HashCollectionType
Returns a new instance of HashCollectionType.
82 83 84 85 86 |
# File 'lib/yard/tags/types_explainer.rb', line 82 def initialize(name, key_types, value_types) @name = name @key_types = key_types @value_types = value_types end |
Instance Attribute Details
#key_types ⇒ Object
Returns the value of attribute key_types.
80 81 82 |
# File 'lib/yard/tags/types_explainer.rb', line 80 def key_types @key_types end |
#value_types ⇒ Object
Returns the value of attribute value_types.
80 81 82 |
# File 'lib/yard/tags/types_explainer.rb', line 80 def value_types @value_types end |
Instance Method Details
#to_s(_singular = true) ⇒ Object
88 89 90 91 92 |
# File 'lib/yard/tags/types_explainer.rb', line 88 def to_s(_singular = true) "a#{name[0, 1] =~ /[aeiou]/i ? 'n' : ''} #{name} with keys made of (" + list_join(key_types.map {|t| t.to_s(false) }) + ") and values of (" + list_join(value_types.map {|t| t.to_s(false) }) + ")" end |