class DTK::DSL::QualifiedKey

Constants

Element
QUALIFIED_KEY_DELIM

Attributes

key_elements[R]

Public Class Methods

new(elements_to_copy = []) click to toggle source
# File lib/dsl/qualified_key.rb, line 24
def initialize(elements_to_copy = [])
  @key_elements = copy(elements_to_copy)
end

Public Instance Methods

create_with_new_element?(type, key) click to toggle source
# File lib/dsl/qualified_key.rb, line 28
def create_with_new_element?(type, key)
  new_key_elements = key.nil? ? @key_elements : @key_elements + [Element.new(type, key)]
  self.class.new(new_key_elements)
end
print_form() click to toggle source
relative_distinguished_name() click to toggle source
# File lib/dsl/qualified_key.rb, line 40
def relative_distinguished_name
  unless last = @key_elements.last
    fail Error, "Unexpected that @key_elements is empty" 
  end
  last.key
end

Private Instance Methods

copy(key_elements) click to toggle source
# File lib/dsl/qualified_key.rb, line 49
def copy(key_elements)
  ret = []
  key_elements.each { |el| ret << Element.new(el.type, el.key) }
  ret
end