Class: Rubyang::Database::SchemaTree::UnionType
- Defined in:
- lib/rubyang/database/schema_tree.rb
Instance Attribute Summary
Attributes inherited from Type
Instance Method Summary collapse
- #add_type(type) ⇒ Object
-
#initialize ⇒ UnionType
constructor
A new instance of UnionType.
- #valid?(value) ⇒ Boolean
Constructor Details
Instance Method Details
#add_type(type) ⇒ Object
205 206 207 |
# File 'lib/rubyang/database/schema_tree.rb', line 205 def add_type type @types.push type end |
#valid?(value) ⇒ Boolean
208 209 210 211 212 |
# File 'lib/rubyang/database/schema_tree.rb', line 208 def valid? value result = false result ||= @types.inject( false ){ |r, t| r || t.valid?( value ) } result end |