Class: Habaki::QualifiedName

Inherits:
Node
  • Object
show all
Defined in:
lib/habaki/qualified_name.rb

Overview

name with optional ns prefix

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Node

#to_s

Constructor Details

#initialize(local = nil, prefix = nil) ⇒ QualifiedName

Returns a new instance of QualifiedName.

Parameters:

  • local (String) (defaults to: nil)
  • prefix (String) (defaults to: nil)


11
12
13
14
# File 'lib/habaki/qualified_name.rb', line 11

def initialize(local = nil, prefix = nil)
  @local = local
  @prefix = prefix
end

Instance Attribute Details

#localString

Returns:



5
6
7
# File 'lib/habaki/qualified_name.rb', line 5

def local
  @local
end

#prefixString

Returns:



7
8
9
# File 'lib/habaki/qualified_name.rb', line 7

def prefix
  @prefix
end

Instance Method Details

#read_from_katana(tag) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Parameters:



24
25
26
27
# File 'lib/habaki/qualified_name.rb', line 24

def read_from_katana(tag)
  @local = tag.local
  @prefix = tag.prefix
end

#string(format = Formatter::Base.new) ⇒ String

Parameters:

Returns:



18
19
20
# File 'lib/habaki/qualified_name.rb', line 18

def string(format = Formatter::Base.new)
  @prefix ? "#{@prefix}|#{@local}" : @local
end