Class: Rubyang::Database::SchemaTree::LeafrefType

Inherits:
Type
  • Object
show all
Defined in:
lib/rubyang/database/schema_tree.rb

Instance Attribute Summary

Attributes inherited from Type

#arg

Instance Method Summary collapse

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

#pathObject



182
183
184
# File 'lib/rubyang/database/schema_tree.rb', line 182

def path
  @path.xpath
end

#valid?(data_tree, value) ⇒ Boolean

Returns:

  • (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