Class: Ellington::UniqueTypeArray
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Ellington::UniqueTypeArray
- Defined in:
- lib/ellington/unique_type_array.rb
Instance Method Summary collapse
- #contains_a?(klass) ⇒ Boolean
-
#initialize ⇒ UniqueTypeArray
constructor
A new instance of UniqueTypeArray.
- #push(value) ⇒ Object (also: #<<)
Constructor Details
#initialize ⇒ UniqueTypeArray
Returns a new instance of UniqueTypeArray.
6 7 8 9 |
# File 'lib/ellington/unique_type_array.rb', line 6 def initialize @inner_list = [] super inner_list end |
Instance Method Details
#contains_a?(klass) ⇒ Boolean
18 19 20 21 22 23 |
# File 'lib/ellington/unique_type_array.rb', line 18 def contains_a?(klass) each do |entry| return true if entry.class == klass end false end |
#push(value) ⇒ Object Also known as: <<
11 12 13 14 |
# File 'lib/ellington/unique_type_array.rb', line 11 def push(value) check value inner_list.push value end |