Class: Sortah::ComponentCollection
- Inherits:
-
Hash
- Object
- Hash
- Sortah::ComponentCollection
show all
- Defined in:
- lib/sortah/util/component_collection.rb
Instance Method Summary
collapse
Instance Method Details
#<<(component) ⇒ Object
3
4
5
6
7
|
# File 'lib/sortah/util/component_collection.rb', line 3
def <<(component)
return unless component.respond_to? :name
raise ParseErrorException if component.defined?(self)
self[component.name] = component
end
|
#defined?(dest) ⇒ Boolean
18
19
20
|
# File 'lib/sortah/util/component_collection.rb', line 18
def defined?(dest)
self.keys.include?(dest)
end
|
#valid? ⇒ Boolean
9
10
11
12
13
14
15
16
|
# File 'lib/sortah/util/component_collection.rb', line 9
def valid?
return if self.empty?
self.each_value do |value|
next unless value.respond_to? :valid?
value.valid?(self)
end
end
|