Class: Rubyang::Database::SchemaTree::LeafrefType
- Defined in:
- lib/rubyang/database/schema_tree.rb
Instance Attribute Summary
Attributes inherited from Type
Instance Method Summary collapse
-
#initialize(schema_node, path_arg) ⇒ LeafrefType
constructor
A new instance of LeafrefType.
- #path ⇒ Object
- #valid?(data_tree, value) ⇒ Boolean
Constructor Details
#initialize(schema_node, path_arg) ⇒ LeafrefType
Returns a new instance of LeafrefType.
177 178 179 180 181 |
# File 'lib/rubyang/database/schema_tree.rb', line 177 def initialize schema_node, path_arg @arg = 'leafref' @path_arg = path_arg @path = Path.new schema_node, path_arg end |
Instance Method Details
#path ⇒ Object
182 183 184 |
# File 'lib/rubyang/database/schema_tree.rb', line 182 def path @path.xpath end |
#valid?(data_tree, value) ⇒ Boolean
185 186 187 188 189 |
# File 'lib/rubyang/database/schema_tree.rb', line 185 def valid? data_tree, value result = true result &&= @path.valid? data_tree, true result end |