Class: Gem::List
- Inherits:
-
Object
- Object
- Gem::List
- Includes:
- Enumerable
- Defined in:
- lib/rubygems/util/list.rb
Overview
The Gem::List class is currently unused and will be removed in the next major rubygems version
Instance Attribute Summary collapse
-
#tail ⇒ Object
Returns the value of attribute tail.
-
#value ⇒ Object
Returns the value of attribute value.
Class Method Summary collapse
Instance Method Summary collapse
- #each ⇒ Object
-
#initialize(value = nil, tail = nil) ⇒ List
constructor
A new instance of List.
- #prepend(value) ⇒ Object
-
#pretty_print(q) ⇒ Object
:nodoc:.
- #to_a ⇒ Object
Constructor Details
#initialize(value = nil, tail = nil) ⇒ List
Returns a new instance of List.
9 10 11 12 |
# File 'lib/rubygems/util/list.rb', line 9 def initialize(value = nil, tail = nil) @value = value @tail = tail end |
Instance Attribute Details
#tail ⇒ Object
Returns the value of attribute tail.
7 8 9 |
# File 'lib/rubygems/util/list.rb', line 7 def tail @tail end |
#value ⇒ Object
Returns the value of attribute value.
7 8 9 |
# File 'lib/rubygems/util/list.rb', line 7 def value @value end |
Class Method Details
Instance Method Details
#each ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/rubygems/util/list.rb', line 14 def each n = self while n yield n.value n = n.tail end end |
#prepend(value) ⇒ Object
26 27 28 |
# File 'lib/rubygems/util/list.rb', line 26 def prepend(value) List.new value, self end |
#pretty_print(q) ⇒ Object
:nodoc:
30 31 32 |
# File 'lib/rubygems/util/list.rb', line 30 def pretty_print(q) # :nodoc: q.pp to_a end |
#to_a ⇒ Object
22 23 24 |
# File 'lib/rubygems/util/list.rb', line 22 def to_a super.reverse end |