Class: Ontopia::Topicmaps::IdStringifier

Inherits:
Object
  • Object
show all
Defined in:
lib/ontopia/topicmaps/stringifiers.rb

Constant Summary collapse

NO_VALUE =
'[No ID]'.freeze

Instance Method Summary collapse

Instance Method Details

#to_string(object) ⇒ Object



36
37
38
39
40
41
42
43
# File 'lib/ontopia/topicmaps/stringifiers.rb', line 36

def to_string(object)
  case object
    when TopicIF            then to_string(object.get_item_identifiers.first)
    when TypedIF            then to_string(object.get_type)
    when URIFragmentLocator then object.fragment
    else                         NO_VALUE
  end
end