Class: Parlour::Types::SingleElementCollection
- Inherits:
-
Type
- Object
- Type
- Parlour::Types::SingleElementCollection
show all
- Defined in:
- lib/parlour/types.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods inherited from Type
#hash, to_type, #to_type
Constructor Details
Returns a new instance of SingleElementCollection.
242
243
244
|
# File 'lib/parlour/types.rb', line 242
def initialize(element)
@element = to_type(element)
end
|
Instance Attribute Details
#element ⇒ Object
Returns the value of attribute element.
247
248
249
|
# File 'lib/parlour/types.rb', line 247
def element
@element
end
|
Instance Method Details
#collection_name ⇒ Object
250
|
# File 'lib/parlour/types.rb', line 250
def collection_name; end
|
#describe ⇒ Object
263
264
265
|
# File 'lib/parlour/types.rb', line 263
def describe
"#{collection_name}<#{element.describe}>"
end
|
#generate_rbi ⇒ Object
253
254
255
|
# File 'lib/parlour/types.rb', line 253
def generate_rbi
"T::#{collection_name}[#{element.generate_rbi}]"
end
|
#generate_rbs ⇒ Object
258
259
260
|
# File 'lib/parlour/types.rb', line 258
def generate_rbs
"::#{collection_name}[#{element.generate_rbs}]"
end
|