Class: Rubyang::Database::SchemaTree::Identityref
- Defined in:
- lib/rubyang/database/schema_tree.rb
Instance Attribute Summary
Attributes inherited from Type
Instance Method Summary collapse
-
#initialize(identity_list, type_stmt) ⇒ Identityref
constructor
A new instance of Identityref.
- #valid?(value) ⇒ Boolean
Constructor Details
#initialize(identity_list, type_stmt) ⇒ Identityref
Returns a new instance of Identityref.
215 216 217 218 219 |
# File 'lib/rubyang/database/schema_tree.rb', line 215 def initialize identity_list, type_stmt @arg = 'identityref' @base_arg = type_stmt.substmt( 'base' ).first.arg @identity_list = identity_list end |
Instance Method Details
#valid?(value) ⇒ Boolean
220 221 222 |
# File 'lib/rubyang/database/schema_tree.rb', line 220 def valid? value @identity_list.select{ |identity| (identity.substmt( 'base' ).first.arg rescue nil) == @base_arg }.any?{ |identity| identity.arg == value } end |