Class: Attributes::List
- Defined in:
- lib/attributes.rb,
lib/attributes-5.0.0.rb
Instance Method Summary collapse
Instance Method Details
#<<(element) ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/attributes.rb', line 6 def << element super self ensure uniq! index! end |
#include?(element) ⇒ Boolean
17 18 19 20 |
# File 'lib/attributes.rb', line 17 def include? element @index ||= Hash.new @index[element] ? true : false end |
#index! ⇒ Object
13 14 15 16 |
# File 'lib/attributes.rb', line 13 def index! @index ||= Hash.new each{|element| @index[element] = true} end |
#initializers ⇒ Object
21 22 23 |
# File 'lib/attributes.rb', line 21 def initializers @initializers ||= Hash.new end |